Last active
September 5, 2017 16:57
-
-
Save mesaugat/6c044f665a77e5756f9b9c6d1fb90889 to your computer and use it in GitHub Desktop.
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
-- | |
-- Most unique commits from Jan 2016 to March 2017 for `mesaugat` | |
-- Change `mesaugat` to any other username to get number of commits for that username | |
-- | |
-- https://bigquery.cloud.google.com/savedquery/39178653524:9a10947dbf8f429da6dd5193592d2d61 | |
-- | |
SELECT | |
u.login AS login, | |
u.location AS location, | |
u.country_code AS country_code, | |
COUNT(c.id) AS num_commits | |
FROM | |
[ghtorrent-bq.ght_2017_04_01.commits] c | |
JOIN ( | |
SELECT | |
login, | |
location, | |
country_code, | |
id | |
FROM | |
[ghtorrent-bq.ght_2017_04_01.users] | |
WHERE | |
login = 'mesaugat' ) u | |
ON | |
c.author_id = u.id, | |
WHERE | |
DATE(created_at) BETWEEN DATE('2016-01-01') | |
AND DATE('2017-04-01') | |
GROUP BY | |
login, | |
location, | |
country_code | |
ORDER BY | |
num_commits DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment