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