update FI_VariableCost
set 
RT_TonCost = case when (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670)>2000 then 0 else (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) end

解决方案 »

  1.   


    update FI_VariableCost
    set
    RT_TonCost = case when (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670)>你要设置的数 then 0 else (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) end
      

  2.   

    update FI_VariableCost 
    set RT_TonCost = 
    case when (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) >? then '0'
    else (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670)
    end
      

  3.   

    写存储过程来进行SQL的算法比较好一点。在存储过程里面写IF判断。你也可以直接用普通更新的形式去改变。用where来接判断条件。
      

  4.   

    update FI_VariableCost 
    set RT_TonCost = (case when((RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) > 0) then 0 else
    (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) end case)
      

  5.   

    update FI_VariableCost  set RT_TonCost = case  when (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) >某數 then 0 else  (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) end
      

  6.   

    update FI_VariableCost  set RT_TonCost = case  when (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) >NUM then 0 else  (RT_TotalCost + 1564191.95922996) / (0.0018 * 0.005670) end