In my query, since there is no filter it is returning all records. so add a WHERE condition something like shown below. (eg:- somecolumn=2324)
select rowno from
(select row_number() over(order by servwait_pk) rowno, *
from yourtable where somecolumn=somevalue) a
where student_fk = 39170
Let me know
Raj