使用mysql 统计函数 结果为null时返回值改为0

SELECT COALESCE(SUM(total),0)  FROM test_table

原文地址:https://www.cnblogs.com/modou/p/7699373.html