如果是ORACLE可以用DECODE函数实现
select decode(0,days,salary,salary/days) from table;

解决方案 »

  1.   

    在 SQL SERVER 中可以用decode吗?
      

  2.   

    用case when x=0 then 0 else y/x end
      

  3.   

    应该是除数吧。
    不管在oracle还是sql server中只能先判断是否为0
    用decode是行不通的
      

  4.   

    To :: kerisyml(魂之利刃) 
         在ORACLE中为什么用DECODE不能实现???
    请赐教!
      

  5.   

    ORACLE:
    select nvl(FieldName,100) from TableName
      

  6.   

    case @Number 
      when 0 then 0
      else @amount / @number
    endsql server 
      

  7.   

    to ATCG(ATCG)
       我试过的,肯定不行的。你试过吗???