Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

oracle first row

SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC)
    WHERE ROWNUM = 1;
-- Oracle 12c:
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 1 ROW ONLY;
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 10 ROW ONLY;
SELECT * FROM (SELECT [COLUMNS] FROM [TABLE] ORDER BY [DATE] DESC) 
    FETCH FIRST 10 ROWS ONLY;
 
PREVIOUS NEXT
Tagged: #oracle #row
ADD COMMENT
Topic
Name
7+4 =