Create Table tmp (A varchar(10),B VARCHAR(10))
insert into tmp values('a','1')
insert into tmp values('b','2')
insert into tmp values('v','3')
Select * from tmp
output
A B
a 1
b 2
v 3
Update #tmp Set A=B, B=A
Select * from tmp
swapped output
A B
1 a
2 b
3 v
No comments:
Post a Comment