How to add plus one (+1) to a SQL Server column in a SQL Query

后端 未结 2 1311
孤街浪徒
孤街浪徒 2021-02-01 13:10

The simple question is, how do you increment a field value in a MS Query by 1 ? I am trying to add 1 (+1) to an int column in my SQL Server database using a paramet

2条回答
  •  佛祖请我去吃肉
    2021-02-01 13:27

    You need both a value and a field to assign it to. The value is TableField + 1, so the assignment is:

    SET TableField = TableField + 1
    

提交回复
热议问题