Skip to content

Commit 08711de

Browse files
authored
Create user-activity-for-the-past-30-days-i.sql
1 parent 7eaff61 commit 08711de

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Time: O(n)
2+
# Space: O(n)
3+
4+
SELECT activity_date AS day,
5+
Count(DISTINCT user_id) AS active_users
6+
FROM activity
7+
GROUP BY activity_date
8+
HAVING Datediff("2019-07-27", activity_date) < 30
9+
ORDER BY NULL

0 commit comments

Comments
 (0)