case when age > 10 then '大' else '小' end
看行不行,我没有试过

解决方案 »

  1.   

    select id,name,decode(sign(age-10),1,'大',-1,'小','相等') as agestr from table
      

  2.   

    oracle8.16或以上
    select id,name,(case when age > 10 then '大' else '小' end) as agestr from table
      

  3.   

    select id,name,case when age>10 then '大' else '小' end agestr from table
      

  4.   

    可以是同decode,sign转换
    select decode(sign(col -10),1,'大于',0,'等于',-1,'小于') from table_a
      

  5.   

    decode函数
    select id,name, decode (sign(age-10),1,'大',0,'等',-1,'小') as agestr from table或者 case语句
    select  id,name 
    case when age>10 then '大' elsif age =10 then '等' else '小' 
    end as agestr
    from table
      

  6.   

    soory case 语句应该为:select  id,name 
    case when age>10 then '大' 
         when age =10 then '等' 
          else '小' 
    end as agestr
    from table