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.
Leave a Reply