with t1 as (select cid,start_time as count_time, 1 as count_num from play_record_tb union all select cid,end_time as count_time, -1 as count_num from play_record_tb), t2 as (select cid,count_time,count_num, sum(count_num)over(partition by cid order by count_time,count_num) as current_num from t1) select cid,max(current_num) as max_peak_uv from t2 group by cid order by max_peak_uv desc limit 3

京公网安备 11010502036488号