PDA

View Full Version : Resolved switch contence of columns


BubikolRamios
01-07-2010, 12:28 PM
c1 c2
a c
b d

-->

c1 c2
c a
d b


was thinking that I could do this somehow like this




update tab set @temp_c2 = c2, c2=c1, c1 = @temp_c2


and wariations, couldnt get it work. any suggestion ?

BubikolRamios
01-07-2010, 04:03 PM
this works:

update table set c1 = @a:=c1,c1 = c2, c1 = @a;