Mysql查询?很急,坐等

http://img.mukewang.com/592137ea00018fe204120178.jpg

a表id相同的记录将num求平均值,然后插入到b表对应的id记录avg字段上

慕粉13212751343
浏览 1280回答 3
3回答

用户1084380

UPDATE b SET b.avg = (SELECT avg(a.num) as avg from a GROUP BY a.id HAVING a.id = b.id);
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL