Answers for "how to use limit command in oracle sql"

SQL
12

oracle sql limit results

-- 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;
Posted by: Guest on January-31-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language