题解 | 播放量峰值top3高的视频
播放量峰值top3高的视频
https://www.nowcoder.com/practice/ee4800f8034f4a34b2daa46bb2e28a27
select
t.cid,
max(t.cnt) as max_peak_uv
from
(select
a.cid,
sum(if(a.start_time between b.start_time and b.end_time,1,0)) as cnt
from
play_record_tb a
join
play_record_tb b
on
a.cid=b.cid
group by
a.id,a.cid,a.start_time
) t
group by
t.cid
order by
max_peak_uv desc
limit
3
正浩创新EcoFlow公司福利 768人发布