我贴段代码,看对你有没有用啊?
select zh,;
sum(cs) as 总笔数,SUM(je) as 总金额,;
sum(iif(处理信息='成功',cs,0)) as 成功笔数,sum(iif(处理信息='成功',je,0)) as 成功金额,;
sum(iif(处理信息='冲正',cs,0)) as 冲正笔数,sum(iif(处理信息='冲正',je,0)) as 冲正金额,;
sum(iif(处理信息='该用户未签约!',cs,0)) as 未签约笔数,sum(iif(处理信息='该用户未签约!',je,0)) as 未签约金额,;
sum(iif(处理信息='可用余额不足',cs,0)) as 余额不足笔数,sum(iif(处理信息='可用余额不足',je,0)) as 余额不足金额,;
sum(iif(处理信息='签约关系不一致!',cs,0)) as 不一致笔数,sum(iif(处理信息='签约关系不一致!',je,0)) as 不一致金额,;
sum(iif(处理信息='账户已冻结',cs,0)) as 冻结笔数,sum(iif(处理信息='账户已冻结',je,0)) as 冻结金额 ;
from aaa group by zh