SQL中SUM函数返回NULL的解决办法

1.oracel:使用NVL()函数:

select nvl(sum(num),0) from table

2.mysql:使用IFNULL()函数

select ifnull(sum(num),0) from table
原文地址:https://www.cnblogs.com/birkhoff/p/6057459.html