SQL中Case when 方法的使用

update T_Product set amount=(
case  
when quantity<10 then  amount*(1-0.1)
when quantity between 10 and  20  then amount*(1-0.2)
else amount*(1-0.3)
end
)

 

posted @ 2012-06-13 22:43  Tom Fan  阅读(151)  评论(0编辑  收藏  举报