SELECT gender, university, COUNT(device_id) 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 #关键是最后一步排序依据不能少,前面都写好了提交发现报错,检查了几遍发现是没有写orderby这一步