同時查新多个条件的数量
- select sum(DECODE(trim(t.ASSESSED_RESULT),'维持',1,0)) maintainNum,
- sum(DECODE(trim(t.ASSESSED_RESULT),'晋升',1,0)) upNum,
- sum(DECODE(trim(t.ASSESSED_RESULT),'降级',1,0)) degradeNum,
- sum(DECODE(trim(t.ASSESSED_RESULT),'终止合同',1,0)) dissolutionNum
- from t_AssessResultInfo t, t02salesinfo_backup s
- where s.team_id=#{teamId} and t.sales_code=s.sales_code and s.channel_id=#{channelId} and s.year_month=#{month}
- and s.year_month=t.stat_month
来源: http://www.bubuko.com/infodetail-2726164.html