ifnull()mysql的一个内置函数,用于处理空值(NULL)。
如果不为 NULL
,ifnull
函数会返回第一个参数,否则返回第二个参数。
例子
select
ifnull(
(select salary
from Employee
order by salary
desc
limit 1,1),null) as SecondHighestSalary
ifnull()mysql的一个内置函数,用于处理空值(NULL)。
如果不为 NULL
,ifnull
函数会返回第一个参数,否则返回第二个参数。
例子
select
ifnull(
(select salary
from Employee
order by salary
desc
limit 1,1),null) as SecondHighestSalary