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

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

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

2.mysql:使用IFNULL()函数

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

 

posted @ 2016-11-12 20:14  birkhoff001  阅读(2670)  评论(0编辑  收藏  举报