Limiting Results

Limiting Rows:

  • Use ROWNUM or FETCH FIRST to limit the number of rows returned.

Example:

SELECT * FROM employees
WHERE ROWNUM <= 5;

Explanation: This query retrieves the first five records from the employees table. ROWNUM is a pseudo-column that indicates the order of rows returned by a query.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *