Created
May 11, 2021 05:43
-
-
Save ittus/aa4d2fc64fe66c8a9b93f0707acab046 to your computer and use it in GitHub Desktop.
[Medium] Cohort - 3
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
WITH user_activities AS ( | |
SELECT A.person_id, DATEDIFF('day', C.start_time, date_trunc('day', A.start)::date) AS period_number | |
FROM activities A | |
LEFT JOIN new_users C ON A.person_id = C.person_id | |
GROUP BY 1, 2 | |
HAVING period_number < 10 | |
ORDER BY 1, 2 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment