首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

update 中字段取值的有关问题

2012-05-28 
update 中字段取值的问题。update table1 set vol vol + 20, set Amount price * vol where ...这时 Am

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表中的值

热点排行