需求:

        按段分组,统计各组下总数

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

 

select

pricegroup,count(*)

from

      ( select

         case

         when money >= 0 and money <10 then '0-10'

         when money >= 10 and money <20 then '10-20'

         when money >=20 then '20以上'

         end as pricegroup

          from pricetable ) as T1

group by pricegroup

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄