I would like to perform an UPDATE
in MYSQL
in which I take a field value, add a constant and save the new value in the same field.
Let's assume that we have a column called OldValue
in a table called aTable
.
Pseudocode could be:
UPDATE aTable SET OldValue = OldValue + 220 WHERE someField = someValue
Do you have any idea on how I could do that? I would like to use a single query (on some administration panel) without making a php
script. (Of course, in that case the answer is quite simple.)
Here is a working example using Pseudocode from original question itself.
Your code will work.
See it working in SQLFiddle.
I used your exact query verbatim, except for substituting a real value for "someValue".