分类: Oracle
2009-08-30 21:48:47
case when x = y then a else b end case when x < y then a when x = y then b else c end case XYZ when 'foo' then 'moo' else 'bar' end
test_case_when ( a varchar2(5), b varchar2(5) ); insert into test_case_when values ('*','*'); insert into test_case_when values ('+','+'); insert into test_case_when values ('-','-'); insert into test_case_when values ('.','.'); a, case when b = '*' then 'star' when b = '+' then 'plus' when b = '-' then 'minus' else '????' end from test_case_when;
A CASEW ----- ----- * star + plus - minus . ????
drop table test_case_when;