题解 | #分组计算练习题#
分组计算练习题
https://www.nowcoder.com/practice/009d8067d2df47fea429afe2e7b9de45
select gender,university, count(gender) as user_num, round(avg(active_days_within_30),1) as avg_active_day, round(avg(question_cnt),1) as avg_question_cnt from user_profile group by gender,university order by gender,university
mysql8.0对于group by 子句进行了调整:不再支持隐式排序。如果还想实现排序效果,需要添加order by子句进行显示排序