尝试使用MySQL向当前字段值加1,但无法弄清楚我的语法出了什么问题 [英] Trying to add 1 to current field value with MySQL, but can't figure out what's wrong with my syntax
本文介绍了尝试使用MySQL向当前字段值加1,但无法弄清楚我的语法出了什么问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望有人可以在此MySQL查询中发现我的错误.
I'm hoping someone can spot my mistake in this MySQL query.
UPDATE 'databasename'.'tablename'
SET fieldB = fieldB + 1
WHERE fieldA = '2';
我基本上是想将fieldA的当前值加1,其中fieldA为2.
I'm basically trying to add 1 to the current value of fieldB where fieldA is i.e 2.
推荐答案
You can use backticks around the database and tablenames; they aren't strictly necessary though.
这篇关于尝试使用MySQL向当前字段值加1,但无法弄清楚我的语法出了什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文