The OFFSET FETCH
clause implements pagination in a more concise manner. With it, it's possible to skip N1 rows (specified in OFFSET
) and return the next N2 rows (specified in FETCH
):
SELECT *
FROM sys.objects
ORDER BY object_id
OFFSET 40 ROWS FETCH NEXT 10 ROWS ONLY
The ORDER BY
clause is required in order to provide deterministic results.