时间:2021-07-01 10:21:17 帮助过:4人阅读
select BQDM,sum(case when HFBZ=‘0‘ then 1 ELSE 0 end) bxschf,
sum(case when HFBZ=‘1‘ then 1 ELSE 0 end) xschf,
sum(case when HFBZ=‘2‘ then 1 ELSE 0 end) yschf,
sum(case when HFBZ=‘3‘ then 1 ELSE 0 end) xxghf
from T_ZYBR_INFO
group by BQDM
sql分组统计多列值
标签: