select min(er.score) as min_score_over_avg # 获取符合列最小的数 from exam_record er join examination_info ei using(exam_id) where tag = 'SQL' AND score >= ( select avg(e1.score) from exam_record e1 join examination_info e2 using(exam_id) where tag = 'SQL' ) # 选中sql类,分数大于平均分,这里的平均分用子查询获取直接使用