with t as (
select a.cid, a.id, count(1) as cnt
from play_record_tb a join play_record_tb b
on a.cid=b.cid and a.start_time>=b.start_time and a.start_time<=b.end_time
group by a.cid, a.id
)
select distinct cid, cast(cnt as float) as max_peak_uv
from t
where (cid, cnt) in (select cid, max(cnt) from t group by cid)
order by max_peak_uv desc
limit 3

京公网安备 11010502036488号