select agent_id, count(1) as zbs,sum(je) as zje from (
select agent_id,
sum(case when sjje < 2000 and fxzt = 0 then sjje
when sjje < 2000 and fxzt = 1005 then -1*sjje end) je
from t_payfee_power where result_code = 0 and fxzt in (0,1005)
) a group by a.agent_id
求总数case when
最新推荐文章于 2022-09-09 22:20:25 发布