Last active
February 25, 2018 23:28
-
-
Save Yenwod/09853eb4bd5e6ffca8a9fb2405888340 to your computer and use it in GitHub Desktop.
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
-- how many new users signed in past 24 hours? | |
--select id, email, name, sign_in_count, last_sign_in_at, created_at | |
select count(*) | |
from users | |
where NOW() > last_sign_in_at | |
AND NOW() - last_sign_in_at <= interval '24 hours' | |
and sign_in_count = 1; | |
-- how many return users? | |
--select id, email, name, sign_in_count, last_sign_in_at, created_at | |
select count(*) | |
from users | |
where NOW() > last_sign_in_at | |
AND NOW() - last_sign_in_at <= interval '24 hours' | |
and sign_in_count > 1; | |
-- how many lot searches? | |
select count(*) | |
from lot_search_logs | |
where NOW() > created_at | |
AND NOW() - created_at <= interval '24 hours' | |
-- any unconfirmed registrations? | |
--select id, email, name, sign_in_count, last_sign_in_at, created_at, confirmed_at | |
select count(*) | |
from users | |
where NOW() > last_sign_in_at | |
AND NOW() - last_sign_in_at <= interval '24 hours' | |
and confirmed_at is null ; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment