note
erix
<p>One would think something should be possible with ROLLUP:
[https://dev.mysql.com/doc/refman/5.7/en/group-by-modifiers.html]
<p>Unfortunately I have no mysqld instance handy. It was not hard to do [ https://www.postgresql.org/docs/current/static/queries-table-expressions.html#QUERIES-GROUPING-SETS | with postgres' GROUPING SETS ] (but it turned out to be slightly slower than [choroba]'s UNION-approach above).
1186784
1186784