select university, round(sum(cnt)/count(id),4) as avg_answer_cnt from (select device_id as id, count(question_id) as cnt from question_practice_detail group by id) temp left join user_profile on temp.id=user_profile.device_id group by university order by university 二次聚合,先算每名同学做了多少题,再算每所学校的同学平均做了多少题,...