SELECT * FROM table WHERE ROWNUM <= 10;
SELECT * FROM (
SELECT t.*, ROWNUM as r FROM table t WHERE ROWNUM <= 20
)
WHERE r > 10;
SELECT * FROM (
SELECT t.*, ROWNUM as r FROM table t ORDER BY id
)
WHERE r <= 10;
SELECT * FROM (
SELECT t.*, ROWNUM as r FROM table t WHERE name = 'John'
)
WHERE r <= 10;