Created
April 21, 2019 14:26
-
-
Save pt2121/1323b6f47994e034a6c224d89341281f 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
SELECT device_model, COUNT(user_id) AS USERS | |
FROM app.data | |
WHERE user_id IN (SELECT user_id FROM app.data WHERE created_at BETWEEN TO_TIMESTAMP('01-01-2018', 'dd-mm-yyyy') AND TO_TIMESTAMP('01-07-2018', 'dd-mm-yyyy')) | |
AND user_id NOT IN (SELECT user_id FROM app.data WHERE created_at > TO_TIMESTAMP('01-07-2018', 'dd-mm-yyyy')) | |
GROUP BY device_model | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment