mysql查询字段为null 返回0

SELECT   IF(AVG(字段) IS NULL,0, 字段) as 重命名   From  xxx

原文地址:https://www.cnblogs.com/to-creat/p/6669701.html