update table2 b,(select b.area_id as arid,sum(a.user_amount) as bcount
from table1 a,table2 b
where a.user_area=b.area_id
group by arid) c
set b.count=c.bcount
where b.area_id=c.arid;
UPDATE语句:将一个表里的字段更新到另一个表的字段里的语句
原文:http://www.cnblogs.com/jthb/p/4286938.html