题解 | #得分不小于平均分的最低分#
得分不小于平均分的最低分
http://www.nowcoder.com/practice/3de23f1204694e74b7deef08922805b2
窗口函数的拓展
1、avg() over()
select
tmp1.score
from(SELECT
r.*
,avg(r.score) over (partition by i.tag) as av
from examination_info i left join exam_record r on i.exam_id=r.exam_id
where i.tag='SQL'
)tmp1
where tmp1.score>=tmp1.av
order by tmp1.score
limit 1