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

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

2.mysql:使用IFNULL()函数

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

 

相关文章: