Answers for "get the first 10 rows oracle query"

SQL
12

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

Find First 10 Row in Oracle SQL

SELECT * FROM (
  SELECT DISTINCT 
  APP_ID, 
  NAME, 
  STORAGE_GB, 
  HISTORY_CREATED, 
  TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') AS HISTORY_DATE  
  FROM HISTORY WHERE 
    STORAGE_GB IS NOT NULL AND 
      APP_ID NOT IN (SELECT APP_ID FROM HISTORY WHERE TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') ='06.02.2009')
  ORDER BY STORAGE_GB DESC )
WHERE ROWNUM <= 10
Posted by: Guest on June-16-2021

Code answers related to "get the first 10 rows oracle query"

Code answers related to "SQL"

Browse Popular Code Answers by Language