题解 | 分组计算练习题
select gender,university,count(id) as user_num, avg(active_days_within_30) as avg_active_day, avg(question_cnt) as avg_question_cnt from user_profile group by gender,university order by gender
一定要注意最后需要排序,需要按照gender进行排序一下,另外有的题解里面写的avg_active_day加了s,注意这里题目里面是没有s的,一定要注意,不要踩雷