Leetcode Note: MySQL - User Activity for the Past 30 Days I

User Activity for the Past 30 Days I - LeetCode
https://leetcode.com/problems/user-activity-for-the-past-30-days-i/

  • MySQL で取り組んだメモ

回答

just do what is asked step by step. - LeetCode Discuss
https://leetcode.com/problems/user-activity-for-the-past-30-days-i/discuss/1961049/just-do-what-is-asked-step-by-step.

SELECT activity_date AS day, COUNT(DISTINCT user_id) AS active_users
FROM Activity
WHERE (activity_date > "2019-06-27" AND activity_date <= "2019-07-27")
GROUP BY activity_date;