Last active
April 22, 2016 16:40
-
-
Save alexleventer/5d64ee0c55c3cc64c839d898b10ee68f to your computer and use it in GitHub Desktop.
Favorite Queries
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 applications.domain, users.email, users.time as SignupDate, count(*) AS Apps, | |
(SELECT COUNT(*) FROM tasks where tasks.domain = applications.domain) as Builds, | |
(SELECT COUNT(*) FROM deployments WHERE deployments.domain = applications.domain) as Deploys, | |
(SELECT COUNT(*) FROM oauth WHERE oauth.domain = applications.domain) as SourceControl | |
FROM applications | |
JOIN users ON applications.domain = users.domain | |
WHERE users.time > UNIX_TIMESTAMP(CURRENT_TIMESTAMP - INTERVAL 1 WEEK) * 1000 | |
GROUP BY applications.domain; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment