求一个update join的问题
a表:id,money
b表:id,meony
a的id唯一,b的id可重复,b的id一定存在于a中
要求a.money=sum(b.money) group by b.id
------解决方案--------------------UPDATE A SET A.money = (SELECT SUM(money) FROM B WHERE A.ID = B.ID GROUP BY B.ID )
------解决方案--------------------UPDATE A SET A.money = (SELECT SUM(money) FROM B WHERE A.ID = B.ID GROUP BY B.ID )
where exists (select 1 from A.ID = B.ID);