Oracle 中 case when的2种用法(case when null)

1、简单Case函数

case a.if_adddrivinglicense when '是' then (b.typename || '/' || a.new_drivinglicens) else b.typename end

2、Case搜索函数

case when a.tempaddrnumb is null then null else '居住证' end

例:

select a.employee_name,(case when a.tempaddrnumb is null then null else '居住证' end) as tempaddrname from oms_employee a where a.employee_name like '%彪%';

猜你喜欢

转载自blog.csdn.net/tanzongbiao/article/details/82527567