Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更新我的查询中的一个值,但我想将以前的值相加。例如,如果我存储了 10 的值并且我想用 15 进行更新,那么新值应该是 25。我该怎么做?
UPDATE YourTable SET YourColumn = YourColumn+15
(尽管我鼓励您对此使用过滤器UPDATE)
UPDATE
您可以更新表格并将列设置为自身 + nn您要添加的新值在哪里
n
UPDATE table SET columnname = columnname + n
UPDATE tableName SET value = value+15; GO