题解 | 错误答案|个人笔记
SQL类别高难度试卷得分的截断平均值
https://www.nowcoder.com/practice/a690f76a718242fd80757115d305be45
having我这样写不对
select tag, difficulty, avg(score) clip_avg_score from exam_record left join examination_info on examination_info.exam_id = exam_record.exam_id where tag = 'SQL' and difficulty = 'hard' group by tag, difficulty having score != max(score) and score != min(score)
having为分组过滤条件,它对返回的结果集操作。
having字段不是有聚合函数就行,聚合函数是组筛选的条件
一般用 having max(column1) </>/= 某个值
SQL解题笔记 文章被收录于专栏
记录解题过程中遇到的问题、出现的错误以及掌握不牢固的知识点