SELECT title,input_date,author,decode(isactive,0,'是',1,'否','其它') sign from impnote;

解决方案 »

  1.   

    能解释一下decode里面的参数吗,还有sign是什么意思?
      

  2.   

    decode(isactive,0,'是',1,'否','其它')  
    如果isactive的值=0,返回:'是'
    如果isactive的值=1,返回:'否'
    其它值,返回:'其它'sign(n) 如果n>0 return 1,n<0 return -1,n=0 return 0.
      

  3.   

    decode 第一个参数 字段名
    第二个   第一个用来比较的值其实相当于这样一个
    if(inactive =0) then sign='是'
    else if(inactive=1) then sign= '否'
    else='其它'
    sign是命名最后结果的字段名
      

  4.   

    呵呵,我以为是问我sign()函数的用法呢
    上面的语句中 sign是我随便写的一个 列的别名。
      

  5.   

    我最后写成这样搞定的 谢谢大家帮忙。
    select title,input_date,author,isactive from (select title,input_date,author,decode(isactive,0,'是',1,'否') as isactive from impnote)