oracle select first 10 rows
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
WHERE ROWNUM >= 1 AND ROWNUM <=10;
-- Oracle 12c:
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
FETCH FIRST 10 ROWS ONLY;
oracle select first 10 rows
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
WHERE ROWNUM >= 1 AND ROWNUM <=10;
-- Oracle 12c:
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
FETCH FIRST 10 ROWS ONLY;
oracle select first row
-- NOTE: This is for Oracle/PLSQL only
-- > EXAMPLE
select *
from CONSUMERS
where ROWNUM <= 1
/*
-- > SYNTAX
select *
from {yourTable}
where ROWNUM <= {number-of-rows}
*/
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us