update tableA a,(select a.netbar_id,sum(a.reward_amt) reward_amt from tableB a group by a.netbar_id) b set a.transfer_amt=b.reward_amt where a.netbar_id=b.netbar_id; 执行该语句时要注意,因为 select a.netbar_id,sum(a.reward_amt) reward_amt from tableB a group by…