select * from (select row_number() over( order by id)as rid,* from emp)s where rid =2
Yours query is not correct. It will pull only second record which is inserted in emp table but not the record with second highest salary..Please check it once.
select * from (select row_number() over( order by id)as rid,* from emp)s where rid =2
Yours query is not correct. It will pull only second record which is inserted in emp table but not the record with second highest salary..Please check it once.
nice catch i forgot to keep partition by with salary