ORDER BY and LIMIT
ORDER BY sorts the rows; LIMIT keeps the first ones, and OFFSET skips some before that.
FROM dealsSHOW won_valueGROUP BY ownerORDER BY won_value DESCLIMIT 5ORDER BY
Section titled “ORDER BY”ORDER BY <metric | field | alias> [ASC | DESC][, ...]Sort by anything you SHOW or GROUP BY, by an AS name, or by a function you show (ORDER BY sum(amount) DESC). ASC is the default. Later columns break ties:
ORDER BY stage ASC, value DESCLIMIT and OFFSET
Section titled “LIMIT and OFFSET”LIMIT <n> [OFFSET <n>]LIMIT 10 OFFSET 10 shows rows 11 to 20. A report returns at most 1,000 rows.
In a cohort report, LIMIT sets how many periods each cohort follows.
For “top 5 owners”, either sort and limit, or use TOP to keep the rest as an Other row:
GROUP BY TOP 5 owner