/* 我总感觉这么写怪怪的,group by 有的学一下啊*/ select gender ,university ,count(1) as user_num, sum(active_days_within_30)/count(1) as avg_active_day, sum(question_cnt)/count(1) as avg_question_cnt from user_profile group by gender,university;