select
type1=sum(case when num > 0 and num < 20 then 1 else 0 end),
type2=sum(case when num > 20 and num < 30 then 1 else 0 end),
...
from table
type1=sum(case when num > 0 and num < 20 then 1 else 0 end),
type2=sum(case when num > 20 and num < 30 then 1 else 0 end),
...
from table
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货