declare @ta table(a int, b int)
insert into @ta values(1, 3)
insert into @ta values(2, 4)
insert into @ta values(1, 43)
declare @tb table(a int, c int)
insert into @tb values(1, 3)
insert into @tb values(3, 4)
update @tb
set c = a.b
from @tb b, (select a, sum(b) as b from @ta group by a) a
where b.a = a.a
select * from @tb
![](http://www.cnblogs.com/Emoticons/yoyocici/224024437.gif)
![](http://www.cnblogs.com/Emoticons/baimantou/223332344.gif)
![](http://www.cnblogs.com/Emoticons/tusiji/203330832.gif)