空值参与运算:NULL
null 不等同于0 '' 'null'
错误写法:空值参与运算,结果一定也为空
SELECT employee_id,salary "月工资",salary * (1+commission_pct) * 12 "年工资"
FROM employees;
实际解决:引入IFNULL
SELECT employee_id,salary "月工资",salary * (1 + IFNULL(commission_pct,0)) * 12 "年工资" FROM employees;