fetch first 5 rows in oracle sql developer code example
Example: fetch first 5 rows in oracle sql developer
-- Oracle < 11g
SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5;
-- Oracle 12c +
SELECT * FROM emp ORDER BY sal DESC FETCH FIRST 5 ROWS ONLY;