日期:2014-05-18  浏览次数:20418 次

update 中字段取值的问题。

update table1 set vol = vol + 20, set Amount = price * vol where ...

这时 Amount中的vol是加过20的还是没加过20的?有什么说法?

------解决方案--------------------
没加20的,

update table1 set vol = vol + 20,Amount = price * (vol+20) where ...

------解决方案--------------------
沒加過的,同時進行的
------解决方案--------------------
原因他們取的值都是deleted表中的值,而不是取的inserted表中的值