LIMIT caps the number of rows. OFFSET skips rows first, for the next page
of a list.
LIMIT <rows> [OFFSET <rows>]
Without LIMIT, a query returns up to 1 000 rows. A query can return at most
10 000. The totals row from WITH TOTALS doesn't count. An export of all rows,
and the spreadsheet in a scheduled email, return up to 10 000 rows unless the
query says otherwise.
LIMIT comes after sorting, so pair it with
ORDER BY to get a top ten.
Top ten products last month
FROM revenue
SHOW net_revenue, units_sold
DURING last_month
GROUP BY product
ORDER BY net_revenue DESC
LIMIT 10The next ten
FROM revenue
SHOW net_revenue, units_sold
DURING last_month
GROUP BY product
ORDER BY net_revenue DESC
LIMIT 10 OFFSET 10A larger limit than 10 000 is an error:
FROM revenue
SHOW net_revenue
DURING last_year
GROUP BY day, product
LIMIT 50000