MYSQL - adding a fixed number to already populated data
I've been trawling SO and cant find what i'm after:
I need to change some order_id numbers in a table, by simply adding a set
number ( eg 40) to the existing set of order_id.
IE i have order_id set to 100 but i need to change it to 140. Simple for
few bits of data, but i have over a 1000 and cant work how to +40 to each
number.
I'm assuming something like: UPDATE table SET order_id = number THEN +40
Obviously this is wrong, but i cant find a simple way to do it. Any help
appreciated.
No comments:
Post a Comment