[MySQL] How to swap columns values in a table
I find a very useful webpage on how to swap columns values in MySQL. In that article are presented three methods, of which I’ve chosen the following one which makes use of a temporary variable:
UPDATE table SET x=(@temp:=x), x = y, y = @temp WHERE condition....