Declare @t table(A varchar(10),B varchar(10)) Insert @t Select '2',NULL union all Select '3',NULL union all Select '4',NULL union all Select '2',NULL union all Select '34',NULL Update @t Set b=a /* A B ---------- ---------- 2 2 3 3 4 4 2 2 34 34(5 行受影响) */
Declare @t table(A varchar(10),B varchar(10))
Insert @t
Select '2',NULL union all
Select '3',NULL union all
Select '4',NULL union all
Select '2',NULL union all
Select '34',NULL Update @t Set b=a
/*
A B
---------- ----------
2 2
3 3
4 4
2 2
34 34(5 行受影响)
*/