题解 | #今天的刷题量(一)#

今天的刷题量(一)

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

select  distinct t.name name,t.cnt cnt from (select
    s2.name name,s1.subject_id sid,
    count(s1.id) over(partition by s2.id ) cnt
from
    submission s1
    left join subject s2 on s1.subject_id = s2.id
where
    s1.create_time = curdate()
    order by cnt desc,sid asc)t

全部评论
这个SQL语句有没有更简洁的写法
点赞 回复 分享
发布于 2023-06-01 09:36 甘肃
为什么要用distinct关键字?,不懂😅
点赞 回复 分享
发布于 2023-06-01 09:09 四川

相关推荐

头顶尖尖的程序员:我是26届的不太懂,25届不应该是找的正式工作吗?为什么还在找实习?大四还实习的话是为了能转正的的岗位吗
点赞 评论 收藏
分享
07-03 16:02
门头沟学院 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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