Hi,
try this
create table test
(
col1 int,
col2 int
)
insert into test values(1,4),(10,5),(2,10),(5,9)
simple one
select * from test
UPDATE test SET col1=col2, col2=col1
select * from test
Now the complex one ;)
select * from test
update t1
set t1.col1=t2.c1,t1.col2=t2.c2
from test t1
join
(
select col2 as c1,col1 as c2 from test
)t2
on t1.col1=t2.c2
select * from test