If you want to swap values of 2 columns (e.g. col1 and col2) in a table (e.g. a_table), you can use below SQL:
UPDATE a_table SET col1=(@temp:=col1), col1 = col2, col2 = @temp;
Do you have another ways? Pls post comment here. Thanks!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment