Skip to main content

LIMIT

Use LIMIT to cap the number of rows a query returns, and add OFFSET to skip rows before the limit applies. Because result order isn't guaranteed without sorting, pair LIMIT with ORDER BY to return a stable set of rows.


Anchor to Row limit and offsetRow limit and offset

Set the maximum number of rows the query returns. Add OFFSET to skip a number of rows first, which pages through results in fixed-size pages. Pair LIMIT with ORDER BY so the rows you keep are deterministic.

Anchor to LIMIT
LIMIT
LIMIT <count>

Returns at most the specified number of rows.

Anchor to OFFSET
OFFSET
LIMIT <count> OFFSET <count>

Skips rows before returning the limited result set.


Was this page helpful?