题解 | #考试分数(三)#

考试分数(三)

https://www.nowcoder.com/practice/b83f8b0e7e934d95a56c24f047260d91

select g1.id, a.name, g1.score
from grade as g1
inner join language as a
on g1.language_id=a.id
where (
    select count(distinct g2.score)
    from grade as g2
    where g1.language_id=g2.language_id
    and g2.score>=g1.score
)<=2
order by a.name asc, g1.score desc, g1.id asc
# 使用where子查询:思想与内连接类似,不过也是一种思路。我们可以知道的是,一般可以使用where子查询的题目,同样可以使用内连接代替
# 
# 

三种解题方式:

全部评论

相关推荐

05-29 20:34
门头沟学院 C++
KarlAllen:得做好直接春招的准备。学历差的话,一是面试要求会比学历好的严格不少,二是就算面试通过了也会被排序。总之暑期和秋招对于学历差的就是及其不友好
无实习如何秋招上岸
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 13:05
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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