题解 | 被重复观看次数最多的3个视频

被重复观看次数最多的3个视频

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

select t2.cid, t2.pv, 
       row_number() over(order by t2.pv desc, 
                        course_info_tb.release_date desc) rk
from (select cid, sum(cnt) pv
      from (select cid, uid, count(cid) cnt
            from play_record_tb
            group by cid, uid
            having cnt <> 1) t1
      group by cid) t2
left join course_info_tb 
on t2.cid = course_info_tb.cid
limit 3;

全部评论
代码哪部分是输出了三位小数呀,为什么我用round结果不改变还是整数
点赞 回复 分享
发布于 2025-03-06 16:59 江苏

相关推荐

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

创作者周榜

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