Skip to content

Instantly share code, notes, and snippets.

@samesense
Created February 12, 2019 21:32
Show Gist options
  • Save samesense/8ab05261429782b7613376ad577edaf2 to your computer and use it in GitHub Desktop.
Save samesense/8ab05261429782b7613376ad577edaf2 to your computer and use it in GitHub Desktop.
gh-query
SELECT
repos.repo_name
FROM
`bigquery-public-data.github_repos.sample_repos` repos
LEFT JOIN
`bigquery-public-data.github_repos.sample_files` files
ON
repos.repo_name = files.repo_name
LEFT JOIN
`bigquery-public-data.github_repos.sample_contents` contents
ON
files.id = contents.id
WHERE
NOT contents.binary
AND contents.content like '%MRN%'
AND contents.content like '%Last%'
GROUP BY
repos.repo_name, repos.watch_count
ORDER BY
repos.watch_count DESC
LIMIT
30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment