LIMIT

A clause that returns at most a given number of rows, optionally after skipping a number of rows with OFFSET.

In more detail

LIMIT is what SQLite, MySQL and PostgreSQL all accept; the SQL standard spelling is fetch first n rows only, which PostgreSQL supports and SQLite does not. Without ORDER BY, which rows you get is not defined. OFFSET still reads and discards the skipped rows.

Example

SELECT id, name FROM products ORDER BY id LIMIT 3 OFFSET 3;

Related terms

Taught in

References