select 月份,
小于100=sum(case when 金额<100 then 1 else 0 end),
100-200=sum(case when 金额>=100 AND 金额<=200 then 1 else 0 end),
大于200=sum(case when 金额>200 then 1 else 0 end)
from 表A
group by 月份
select 月份 sum(a) as 小于100(条), sum(b) as a100-200(条), sum(c) as 大于200(条)
from
(
select 月份 ,count(*) as a,0 as b,0 as c
from A表
where 金额<100
group by 月份
union all
select 月份 ,0 as a, count(*) as b,0 as c
from A表
where 金额>=100 and 金额<=200
group by 月份
union all
select 月份 ,0 as a, 0 as b, count(*) as c
from A表
where 金额>100
group by 月份
) as temp