题解 | 播放量峰值top3高的视频

播放量峰值top3高的视频

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

select cid,round(max(peak_uv),3) as max_peak_uv
from(
	select cid,sum(tag)over(partition by cid order by time) as peak_uv
	from(
		select cid,start_time as time,1 as tag
		from play_record_tb
		union all
		select cid,end_time as time,-1 as tag
		from play_record_tb)a)b
group by cid
order by max_peak_uv desc
limit 3


全部评论
我朝,甜菜
点赞 回复 分享
发布于 03-21 18:43 天津

相关推荐

求面试求offer啊啊啊啊:1600一个月?
点赞 评论 收藏
分享
程序员鼓励师阿欢:哈哈哈哈哈笑死我了😂
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务