题解 | #得分不小于平均分的最低分#
得分不小于平均分的最低分
http://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2
over:标识分析函数,确定其前面的avg是分析函数,分析条件为t2.tag
select min(t.score) as min_score_over_avg from (select t1.exam_id,t1.score score,t2.tag tag,avg(score) over(partition by t2.tag) avg_score from exam_record t1 left join examination_info t2 on t1.exam_id=t2.exam_id where t2.tag='SQL' and t1.score is not null) t where t.score>=t.avg_score