SELECT columns FROM table LIMIT count OFFSET skip;
example
SELECT product_name, price
FROM products
ORDER BY created_at DESC
LIMIT 10 OFFSET 20;
output
-- Returns rows 21-30 (skips first 20, then takes 10)
Note MySQL/PostgreSQL use LIMIT. SQL Server uses TOP or FETCH FIRST. High OFFSET values degrade performance because the database still scans skipped rows.
Note RANK leaves gaps after ties (1, 2, 2, 4). DENSE_RANK does not (1, 2, 2, 3). Choose based on whether you need contiguous numbers or positional accuracy.