Most recent in Oracle DB

List the most recently added rows based on a date column.


Public

Tested

My Own Work
To list the most recently 100 modified rows:
Use:
SELECT * from Tab1 ORDER BY moddate desc OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY;

Or:
Select * From (Select * From Tab1 ORder by ModDate desc) Where RowNum<101;

Do Not use:
Select * From Tab1 Where Rownum<101;

Since the last one does not guarantee listing rows by most added

Views 222 Downloads 67

SQL Learning Materials
ANmarAmdeen
719
Attachments
Revisions

v2.0