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