MySQL Forums
Forum List  »  Newbie

Re: mySQL update problem
Posted by: Rick James
Date: April 14, 2014 12:37AM

> And I'll have to run this query after each month for all of them.

And, if you accidentally run the UPDATE twice in a month, you will destroy the data. Rethink how you are handling the updates.

How about doing an INSERT of a new row, and having a date as a column. That way, you could also see the history of salaries.

Back to your question... you are perhaps looking for these:
http://dev.mysql.com/doc/refman/5.5/en/case.html
http://dev.mysql.com/doc/refman/5.5/en/update.html (see the "multi-table" syntax)

Options: ReplyQuote


Subject
Written By
Posted
Re: mySQL update problem
April 14, 2014 12:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.