1SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
2 WHERE ROWNUM >= 1 AND ROWNUM <=10;
3-- Oracle 12c:
4SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
5 FETCH FIRST 10 ROWS ONLY;
1-- NOTE: This is for Oracle/PLSQL only
2
3-- > EXAMPLE
4select *
5from CONSUMERS
6where ROWNUM <= 1
7
8/*
9-- > SYNTAX
10select *
11from {yourTable}
12where ROWNUM <= {number-of-rows}
13
14*/
1SELECT * FROM (
2 SELECT DISTINCT
3 APP_ID,
4 NAME,
5 STORAGE_GB,
6 HISTORY_CREATED,
7 TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') AS HISTORY_DATE
8 FROM HISTORY WHERE
9 STORAGE_GB IS NOT NULL AND
10 APP_ID NOT IN (SELECT APP_ID FROM HISTORY WHERE TO_CHAR(HISTORY_DATE, 'DD.MM.YYYY') ='06.02.2009')
11 ORDER BY STORAGE_GB DESC )
12WHERE ROWNUM <= 10
13