Created
October 27, 2017 12:51
-
-
Save brianbancroft/2093563fee73f40efd2068b283f479c5 to your computer and use it in GitHub Desktop.
Get me some registrations
This file contains 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( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '10 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '30 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '60 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '90 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '120 days' | |
) AS count_users, | |
( | |
SELECT COUNT(*) | |
FROM regs | |
WHERE invite_sent_at <= NOW() - INTERVAL '150 days' | |
) AS count_users | |
FROM regs | |
; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment