SQL query to get count of each group in Google BigQuery

Data

\n\n
Metric\n3\n3\n6\n6\n
\n\n

To get the count of each Group:

SELECT Metric, COUNT(Metric) `Count`
FROM `project.dataset.your_table`
GROUP BY Metric

Result:

\n\n
Metric | Count\n6      | 2\n3      | 2

Ryan-Dallas

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds