oracle case when then 条件判断

select (case when 1=1  then 1  else 2 end) from dual;

select
(case when (6-4)=1  then 1 
      when (6-5)=2  then 2 
      else 2

end)
from dual;

 

 

 

 

select decode(3-1,2,1,3) from dual;

 

表达式3-1,如果等于2返回值1,否则返回3

 

你可能感兴趣的:(oracle)