sum()函数返回值为null 一、SELECT IFNULL(sum(列名),0) from table where id= ‘xxxxx’; 二、SELECT COALESCE(sum(列名),0) from table where id = ‘xxxxx’;