update case when

UPDATE SELF_SERVICE_PLAN t SET t.I_ACT_REPLENISH_AMOUNT =   case  
when t.I_CASH_REPLENISH_AMOUNT > 0 and  t.I_CASH_REPLENISH_AMOUNT < 50001 then 50000
when t.I_CASH_REPLENISH_AMOUNT > 50000 and  t.I_CASH_REPLENISH_AMOUNT < 100001 then 100000  
when t.I_CASH_REPLENISH_AMOUNT > 100000 and  t.I_CASH_REPLENISH_AMOUNT < 150001 then 150000 
when t.I_CASH_REPLENISH_AMOUNT > 150000 and  t.I_CASH_REPLENISH_AMOUNT < 200001 then 200000 
when t.I_CASH_REPLENISH_AMOUNT > 200000 and  t.I_CASH_REPLENISH_AMOUNT < 250001 then 250000 
when t.I_CASH_REPLENISH_AMOUNT > 250000 and  t.I_CASH_REPLENISH_AMOUNT < 300001 then 300000 
when t.I_CASH_REPLENISH_AMOUNT > 300000 and  t.I_CASH_REPLENISH_AMOUNT < 350001 then 350000 
end ;

你可能感兴趣的:(SQL)