Update PollOptions
Set Votes =((Select Votes from PollOptions Where PK_OptionID=3)+1)
我如何使用sql代码编写这个我想增加最后一个值现在它没有运行它给了我错误。
答案 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