Sunday 4 June 2017

To display nth record from the table

To display nth record from the table:
SELECT * FROM emp
WHERE  rowid = (SELECT rowid FROM emp
                              WHERE  rownum <= &n
                              MINUS
                              SELECT rowid FROM emp

                              WHERE  rownum < &n);















OR
select * from (select rownum as n_num,e.* from emp e) d where d.n_num=2