I am doing GROUP BY and COUNT (*) in a dataset, and I would like to calculate the percentage of each group compared to the total.
For example, in this query, I would like to know how many count () for each state represents the sum (select count () from publicdata: samples.natality):
SELECT state, count(*) FROM [publicdata:samples.natality] GROUP by state
There are several ways to do this in SQL, but I have not found a way to do this in Bigquery, does anyone know?
Thanks!
source share