Incremental Query
Method 1: Fetch the record between two records
SELECT * FROM (SELECT emp.*, rownum rn FROM emp ) WHERE rn between 2 and 5;
Method 2: Fetch the record between two records
SELECT * FROM (SELECT q.*, rownum rn FROM( SELECT * FROM emp ) q ) WHERE rn BETWEEN 2 AND 5;
Method 3: Fetch the last record form table
SELECT * FROM (SELECT q.*, rownum rn FROM (SELECT * FROM emp) q ) WHERE rn=(select max(rownum) from emp);
Method 1: Fetch the record between two records
SELECT * FROM (SELECT emp.*, rownum rn FROM emp ) WHERE rn between 2 and 5;
Method 2: Fetch the record between two records
SELECT * FROM (SELECT q.*, rownum rn FROM( SELECT * FROM emp ) q ) WHERE rn BETWEEN 2 AND 5;
Method 3: Fetch the last record form table
SELECT * FROM (SELECT q.*, rownum rn FROM (SELECT * FROM emp) q ) WHERE rn=(select max(rownum) from emp);