Skip to content

Instantly share code, notes, and snippets.

@callicles
Created September 2, 2016 20:52
Show Gist options
  • Save callicles/f2c00b04311db74bcb8b27de97a39a62 to your computer and use it in GitHub Desktop.
Save callicles/f2c00b04311db74bcb8b27de97a39a62 to your computer and use it in GitHub Desktop.
Will give you the number of repository that did not receive any commit within the last year
SELECT COUNT(sub_github.repo_name)
FROM (
SELECT i.repo_name, MAX(committer.time_sec) as MaxDate
FROM [bigquery-public-data:github_repos.commits] AS i
GROUP BY i.repo_name
) AS sub_github
WHERE sub_github.MaxDate < ((NOW() / 1000000) - 31622400)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment