oracle 关于条件判断

2025-04-05 02:08:20
推荐回答(4个)
回答1:

用decode函数
例如
select decode(字段名,'条件1','值1','条件2','值2',默认值') from 表名
或者 case when
如果是在pl/sql块中
可以用 if 条件 then
else if 条件 then
end if;

回答2:

select * from A,B where 1 or 2;

回答3:

case when?

回答4:

问题补充一下 目的不是很明确