题解 | #得分不小于平均分的最低分#

得分不小于平均分的最低分

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
全部评论

相关推荐

07-02 13:52
门头沟学院 Java
点赞 评论 收藏
分享
这是什么操作什么意思,这公司我服了...
斯派克spark:意思是有比你更便宜的牛马了
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-11 13:34
offe从四面八方来:我真的没时间陪你闹了
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务