mysql sum的多条件求和
1.无条件求和
sum(字段名);
2.多条件求和
1) sum(IF(c1>0, c1, 0));
2)(IF(o.is_cod=0, o.order_amount-IF(b.back_status>0 AND b.back_status<5, b.refund_money, 0), 0)) - SUM(IF(o.is_cod=0, o.shipping_fee, 0)) - SUM(IF(o.change_amount=0, o.change_amount, 0))