Last active
January 24, 2017 17:32
-
-
Save zitterbewegung/85744c754fc295d7c8e2c57cfb219563 to your computer and use it in GitHub Desktop.
Computes the average amount of points of comments per month.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| CONCAT(STRING(YEAR(time_ts)),'-',RIGHT(STRING(100 + MONTH(time_ts)), 2)) AS Month, | |
| AVG(ranking) AS rank, | |
| EXACT_COUNT_DISTINCT([by]) AS CommentSum, | |
| AVG(ranking) / EXACT_COUNT_DISTINCT([by]) AS PerCapita | |
| FROM | |
| [bigquery-public-data:hacker_news.comments] | |
| GROUP BY | |
| 1 | |
| ORDER BY | |
| 1; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment