I have a simple table with two columns Bin_name
(int) and Count_in_this_bin
(int)
I want to convert it to the ratio of each bin to the total count in all bins.
I used the following query in Google BigQuery:
SELECT count_in_bin/(SELECT SUM(count_in_bin) FROM [table])
FROM [table]
Then I get
error:Query Failed Error: Subselect not allowed in SELECT clause
Can anyone let me now the correct way to do this kind of simple divide in BigQuery?