猿问

Mysql查询?很急,坐等

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

相关分类

MySQL
我要回答