比如:select firstName + lastName from employee这里我想先判断lastName是否为空,如果为空的话lastName返回指定默认值,不为空就直接返回数据库中的值。
select firstname + isnull(lastname,默认值) from employee或者select firstname + case when lastname is null then
默认值
else lastname end from employee
时间: 2024-10-11 16:21:43