- Oracle 11 or before
1
2
3
SELECT * FROM (SELECT COLUMN1, COLUMN2 FROM TABLE_NAME ORDER BY COLUMN1 desc) WHERE rownum =1;
- Oracle 12 or above
1
2
3
SELECT COLUMN1, COLUMN2 FROM TABLE_NAME ORDER BY COLUMN1 desc fetch first 1 rows only;
1
2
3
SELECT * FROM (SELECT COLUMN1, COLUMN2 FROM TABLE_NAME ORDER BY COLUMN1 desc) WHERE rownum =1;
1
2
3
SELECT COLUMN1, COLUMN2 FROM TABLE_NAME ORDER BY COLUMN1 desc fetch first 1 rows only;