一般情况下句式:sql中的三目运算符:case
字段
is
null
then
'true'
else
参数
end
例子:state如果为null就显示'n',否则显示state的值
case when state is null then 'n' else state end
需要注意的问题:这里的is null是一个组合使用的字段,如果是要换成其他属性是不能够直接用is当做等号的!(两者不能相互替 代,比如is null 就不能写成,=null,xxxx ='''+aaa+'''也不能写成 xxxx is '''+aaa+'''。)