How do I limit the number of rows returned by an Oracle query after ordering?

Starting from Oracle 12c R1 (12.1), there is a row limiting clause. It does not use familiar LIMIT syntax, but it can do the job better with more options. You can find the full syntax here. (Also read more on how this works internally in Oracle in this answer). To answer the original question, here’s the query: (For earlier Oracle versions, please … Read more