Limiting Rows:
- Use
ROWNUMorFETCH FIRSTto 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.
Leave a Reply