2022-06-29
閱讀量:
583
計算客戶單量分布情況?
select 單量區(qū)間 , count(distinct 客戶id) as 客戶數(shù) 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 單量區(qū)間 from ( select 客戶id,count(distinct 運單號) as 單量 from 快遞攬收表 where 創(chuàng)建日期 >= ‘2020-05-01’ and 創(chuàng)建日期 <= ‘2020-05-31’ group by 客戶id) as t1) as t2 group by 單量區(qū)間;






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論