Byakugan
Byakugan

Reputation: 981

How to update data in database with query that not change original value?

Lets say I have multiple commands like 5000 which updates some column and row in databse - it is number for example

UPDATE salary SET money=2000000 WHERE person=55;

Is there any way how to update such data without destroying the original value? Lets say the money has already exiting and different value? I have searched google and MySQL manual but I did not find any useful query for this. Is there any way how to update such data without destroying the original value? Thank you.

Upvotes: 0

Views: 250

Answers (1)

colonelclick
colonelclick

Reputation: 2215

Your guess was almost perfect.

UPDATE salary SET money=money+2000000 WHERE person=55;

Upvotes: 2

Related Questions