[1]聚合函数返回NULL 当where条件不满足时,聚合函数sum().avg()的返回值为NULL. (1)源数据表 (2)如下SQL语句 SELECT sClass, COUNT(*) AS total, AVG(sChina) AS avg_china, AVG(sMath) AS avg_math, AVG(sEnglish) AS avg_english FROM grades ' (3)实际结果: 温馨提醒:如果不想要这行NULL值的结果集,可以参见随笔<Mysql AVG() 值…