select * from table where table.col001=table.col002
declare @t table(a varchar(10), b varchar(10)) insert @t select '','A' insert @t select '','B' insert @t select '','C' update @t set a=b select * from @t /*a b ---------- ---------- A A B B C C(所影响的行数为 3 行)*/
insert @t select '','A'
insert @t select '','B'
insert @t select '','C'
update @t set a=b
select * from @t
/*a b
---------- ----------
A A
B B
C C(所影响的行数为 3 行)*/