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;
  • 这个题可以不用where,直接排序两个字段,并且用其中值唯一的ID做用户数统计