MySQL Forums
Forum List  »  Newbie

Re: move data to diffrent field in multiple rows
Posted by: Phillip Ward
Date: January 23, 2020 09:59AM

A simple UPDATE should suffice:

update table1 set 
  a = b 
, b = a 
where ...

Values on the right of the "=" signs should always be taken from the table rows so there shouldn't be any problem with doing this.

(Hmmm; Lots of "should"s in that ...)

Obviously, test it out on another table first! :-)

Regards, Phill W.

Options: ReplyQuote


Subject
Written By
Posted
Re: move data to diffrent field in multiple rows
January 23, 2020 09:59AM


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.