如何更新字段以为现有价值增加价值? [英] How to update field to add value to existing value?
本文介绍了如何更新字段以为现有价值增加价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何更新字段以将值添加到现有值?
例如,我有
How to update field to add value to existing value?
For example I have
表名:table
id credit
1 4
2 5
3 3
有没有一种方法可以简单地为信用增加价值?
喜欢
Is there a way to simply add value to the credit?
like
UPDATE table SET credit = '+7' WHERE id='1'
我想加7到4,以便功劳= 11,其中id ='1'
该怎么做?
I want to add 7 to 4 so that the credit=11 where id='1'
How to do this?
推荐答案
UPDATE table SET credit = credit + 7 WHERE id = 1
这篇关于如何更新字段以为现有价值增加价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文