题解|28. 6月份月活
6月份月活
明确题意:
统计6月份的月活
问题拆解:
- 筛选2021年6月份的记录。知识点:where
- 统计月份数。知识点:count(distinct)
代码实现:
select count(distinct user_id) as month_active_user
from logintb
where login_date between "2021-06-01" and "2021-06-30"
统计6月份的月活
select count(distinct user_id) as month_active_user
from logintb
where login_date between "2021-06-01" and "2021-06-30"
相关推荐