xxxxxxxxxx
SELECT *
FROM your_table
WHERE ROWNUM <= 10; -- Limits the result to the first 10 rows
xxxxxxxxxx
ROW_NUMBER ()
OVER ([PARTITION BY value_exp, [ n ]] order_by_clause)
-- OVER - Specify the order of the rows.
-- ORDER BY - Provide sort order for the records.
xxxxxxxxxx
SELECT ROWNUM, a.*
FROM (SELECT customers.*
FROM customers
WHERE customer_id > 4500
ORDER BY last_name) a;
xxxxxxxxxx
Returns results where the row number meets the passed condition.
Example: Returns the top 10 countries from the countries table.
SELECT * FROM countries
WHERE ROWNUM <= 10;