COALESCE代表如果sum的值为null就等于0,if跟需要被sum的条件
SELECT COALESCE(SUM(IF(order_status='4' or order_status='5',premium_amount,0)),0) AS modulePass from order_manage
COALESCE代表如果sum的值为null就等于0,if跟需要被sum的条件
SELECT COALESCE(SUM(IF(order_status='4' or order_status='5',premium_amount,0)),0) AS modulePass from order_manage