如何使用SQl更新旧值?

时间:2010-12-26 11:56:08

标签: sql ms-access

Update PollOptions
Set Votes =((Select Votes from PollOptions Where PK_OptionID=3)+1)

我如何使用sql代码编写这个我想增加最后一个值现在它没有运行它给了我错误。

2 个答案:

答案 0 :(得分:2)

Update PollOptions Set Votes = Votes+1  Where PK_OptionID=3
OP中的SQL可能会更新所有行

答案 1 :(得分:0)

Update PollOptions Set Votes = Votes + 1 where PK_OptionID=3