2022-06-29
阅读量:
559
计算客户单量分布情况?
select 单量区间 , count(distinct 客户id) as 客户数 from ( select 客户id,单量,case when 单量 <= 5 then ‘0-5’ when 单量 >= 6 and 单量 <= 10 then ‘6-10’when 单量 >= 11 and 单量 <= 20 then ‘11-20’else ‘20以上’ end as 单量区间 from ( select 客户id,count(distinct 运单号) as 单量 from 快递揽收表 where 创建日期 >= ‘2020-05-01’ and 创建日期 <= ‘2020-05-31’ group by 客户id) as t1) as t2 group by 单量区间;






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论