题解 | #分组过滤练习题#
分组过滤练习题
https://www.nowcoder.com/practice/ddbcedcd9600403296038ee44a172f2d
select university, avg(question_cnt) as avg_question_cnt, avg(answer_cnt) as avg_answer_cnt from user_profile group by university having (avg_question_cnt <5) or (avg_answer_cnt < 20)
having的用法
having字句可以让我们筛选成组后的各种数据,where字句在聚合前先筛选记录,也就是说作用在group by和having字句前。
而 having子句在聚合后对组记录进行筛选。
SQL学习 文章被收录于专栏
个人学习的一些小总结