原题
思路
一个很垃圾的题,注意日期范围。
代码
select day,count(*) AS active_users from (
select distinct user_id,activity_date as day
from Activity
where activity_date between '2019-06-28' and '2019-07-27'
group by activity_date,user_id
) C GROUP BY day order by day