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. 买本书!

解决方案 »

  1.   

    如果是8.1.5安装上联机帮助后在安装目录下就有
    文档存放在doc文件夹里面
      

  2.   

    顺便说说 case 的用法!
    //从理论上来说,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
      

  3.   

    decode(col_name,'1',1,0)
    相当于
    case when col_name='1' then 1 else 0 end
      

  4.   

    decode(col_name,'1',1,0)
    相当于
    case when col_name='1' then 1 else 0 end