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

今天的刷题量(一)

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

select name,cnt -- 不需要subject_id
from (
    select subject_id,s1.name,count(subject_id) cnt
    from subject s1
    join submission s2 on s1.id=s2.subject_id
    where create_time=current_date -- 获取当日记录
    group by subject_id,s1.name
    order by cnt desc,subject_id -- 先按cnt降序,再按subject_id升序
)t;

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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