BigQuery supports GROUP BY ALL and it really cleans up lots of queries. E.g.
SELECT foo, bar, SUM(baz)
FROM x
GROUP BY ALL <-- equiv to GROUP BY foo, bar
(eh, except MySQL; my memory of MySQL is it will silently do ANY_VALUE() on any columns that aren't an explicit aggregate function but are not grouped; argh it was a long time ago)Suppose...
SELECT brand, model, revision, SUM(quantity)
FROM stock
GROUP BY brand, model, revision
This is not solved by using distinct as you would not get the correct count.Group By All allows you to write it a bit more compact...
SELECT brand, model, revision, SUM(quantity)
FROM stock
GROUP BY ALLI revert to “group by 1, 2, 3… “ when I’m just hacking about. Group by all would definitely be an improvement.