a表id相同的记录将num求平均值,然后插入到b表对应的id记录avg字段上
3 回答
用户1084380
TA贡献5条经验 获得超3个赞
UPDATE b SET b.avg = (SELECT avg(a.num) as avg from a GROUP BY a.id HAVING a.id = b.id);
添加回答
举报
0/150
提交
取消