select gender,university,count(id) user_num,avg(active_days_within_30) avg_active_day,avg(question_cnt) avg_question_cnt from user_profile group by university,gender 先确定分组条件-如题即大学和性别进行分组再分析所要查询的字段,通过聚合函数来达到目的检查语句语法错误注意:聚合函数只能在select ,having,order by 后使用