SUM(CASE WHEN kuangid = 2 THEN DayFact ELSE 0 END) 转载于:https://www.cnblogs.com/windphoenix/archive/2009/09/25/1574271.html