SQL Standard
Since version 12c Oracle supports the SQL:2008 Standard, which provides the following syntax to limit the SQL result set:
SELECT titleFROM postORDER BY id DESCFETCH FIRST 50 ROWS ONLY
Oracle 11g and older versions
Prior to version 12c, to fetch the Top-N records, you had to use a derived table and the ROWNUM
pseudocolumn:
SELECT *FROM ( SELECT title FROM post ORDER BY id DESC)WHERE ROWNUM <= 50