Oracle TOP Keyword Usage Guide

In Oracle, you can use the TOP keyword to limit the number of rows returned in a query. It is typically used in conjunction with the ORDER BY clause to sort the results by a specific column before returning a specified number of rows. For example:

SELECT * FROM table_name ORDER BY column_name DESC FETCH FIRST 10 ROWS ONLY;

In the above example, the query will return the top 10 rows from the table “table_name” sorted in descending order based on the column “column_name”. “FETCH FIRST 10 ROWS ONLY” is the syntax in Oracle used to limit the number of returned rows.

bannerAds