题解 | #小破站9月上中下旬的用户充值数量#
小破站9月上中下旬的用户充值数量
http://www.nowcoder.com/practice/b49f6d9f869b4e5dbce36f4a749f2518
select seg_date,count(seg_date)
from
(
select case when begin_date between '2021-09-01' and '2021-09-10'
then '上旬'
when begin_date between '2021-09-11' and '2021-09-20'
then '中旬'
when begin_date between '2021-09-21' and '2021-09-30'
then '下旬'
end as seg_date
from detail_list_tb
) as t
where seg_date is not null
group by seg_date