Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery calculate grand totals row

Is there any way to add row with grand totals under my result set, like ms-sql ROLLUP operator? I want to avoid using extra query for this totals.

like image 377
Kirill Solokhov Avatar asked Mar 12 '14 15:03

Kirill Solokhov


2 Answers

Edited: BigQuery now supports the ROLLUP operator. See the query reference docs for more information.

like image 113
Jordan Tigani Avatar answered Oct 11 '22 06:10

Jordan Tigani


Update: Since this question was posted, BigQuery did implement support GROUP BY ROLLUP clause compatible with SQL Standard. It is documented here: https://cloud.google.com/bigquery/query-reference#groupby

like image 35
Mosha Pasumansky Avatar answered Oct 11 '22 05:10

Mosha Pasumansky