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