* Problem
Write a solution to find the daily active user count for a period of 30 days ending 2019-07-27 inclusively. A user was active on someday if they made at least one activity on that day.
Return the result table in any order.
* Explanation
Note that we do not care about days with zero active users.
* Solution (Success)
# Write your MySQL query statement below
SELECT
activity_date AS day,
COUNT(DISTINCT user_id) AS active_users
FROM Activity
WHERE activity_date BETWEEN '2019-06-28' AND '2019-07-27'
GROUP BY 1;
'Study - Problems(IT) > LeetCode - SQL' 카테고리의 다른 글
596. Classes More Than 5 Students (2) | 2024.11.23 |
---|---|
1070. Product Sales Analysis 3 (0) | 2024.11.22 |
2356.Number of Unique Subjects Taught by Each Teacher (0) | 2024.11.20 |
550. Game Play Analysis IV (0) | 2024.11.19 |
1174.Immediate Food Delivery2 (2) | 2024.11.17 |