LIMIT / ROWNUM Clause

Purpose: Limits the number of rows returned by a query. In Oracle, this can be done using ROWNUM.Syntax (using ROWNUM):

WHERE ROWNUM <= n;

Example:

SELECT * FROM employees WHERE ROWNUM <= 10;

Explanation: This retrieves the first 10 rows from the employees table. ROWNUM assigns a number to each row in the result set.


Comments

Leave a Reply

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