1.
//就是下面得用法啊!
//如果你是用得 oracle 9i,建议使用 case when 的语法!
insert into abc(aa) values (1);select decode(aa,1,'this is 1',2,'this is 2',3,'this is 3','this is other')
from aa2. 买本书!
//就是下面得用法啊!
//如果你是用得 oracle 9i,建议使用 case when 的语法!
insert into abc(aa) values (1);select decode(aa,1,'this is 1',2,'this is 2',3,'this is 3','this is other')
from aa2. 买本书!
文档存放在doc文件夹里面
//从理论上来说,case 比 decode 要快!SELECT CASE aa WHEN 10 THEN 'this is 10' ELSE CASE aa WHEN 20 THEN 'this is 20' ELSE CASE aa
WHEN 30 THEN 'this is 30' ELSE 'this is other' END
END END
FROM abc
相当于
case when col_name='1' then 1 else 0 end
相当于
case when col_name='1' then 1 else 0 end