How to update field to add value to existing value?

前端 未结 7 2063
迷失自我
迷失自我 2021-01-03 18:11

How to update field to add value to existing value?
For example I have

Table name: table

id   credit
1      4
2      5
3      3
         


        
7条回答
  •  太阳男子
    2021-01-03 19:09

    This is just a simple UPDATE. Try the following.

    UPDATE tableName
    SET Credit = Credit + 7
    WHERE ID = 1
    

    note that ID = 1 and ID = '1' is the same as the server automatically parses it.

提交回复
热议问题