题解 | #分组计算练习题#
分组计算练习题
http://www.nowcoder.com/practice/009d8067d2df47fea429afe2e7b9de45
/* 我总感觉这么写怪怪的,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;