1. 问题提出
客户系统有这样一条SQL,脱敏后如下:
SELECT NVL(MAX(T1.CREATED),SYSDATE) FROM DUAL LEFT JOIN TEST11 T1
ON T1.OWNER’OUTLN’ AND OBJECT_TYPE IS NOT NULL;
SQL是TEST11表和DUAL表相关联,WHERE条件中OWNER字段有索引&…
【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