题解 | 分组过滤练习题
分组过滤练习题
https://www.nowcoder.com/practice/ddbcedcd9600403296038ee44a172f2d
select
university,
avg_question_cnt,
avg_answer_cnt
from
(
select
up.university,
AVG(up.question_cnt) as avg_question_cnt,
AVG(up.answer_cnt) as avg_answer_cnt
from
user_profile up
group by
up.university
) ut
where
avg_question_cnt < 5
or avg_answer_cnt < 20

查看18道真题和解析