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 LIMITLIMITLIMITLIMIT <count>LIMIT <count>
Returns at most the specified number of rows.
- Anchor to OFFSETOFFSETOFFSETLIMIT <count> OFFSET <count>LIMIT <count> OFFSET <count>
Skips rows before returning the limited result set.
Was this page helpful?