ifunll函数:ifnull(a,b)当a的结果为null时,整体结果为b,否则为a
a可以是字段
例如:select ename,(sal + ifnull(comm,0))*12 as 'sal + comm' from emp;
a也可以是查询的结果集:目前暂时认为结果集里面的结果只能为一个
例如:select ifnull((select distinct salary from Employee order by salary desc limit 1,1),null) as SecondHighestSalary
注:select作用是选择出想要的结果,进行输出展示