select cid,CAST(ROUND(MAX(cnt),3) AS DECIMAL(10,3)) as max_peak_uv
from( 
    select p1.id,p1.cid,count(distinct p2.uid) as cnt
    from play_record_tb p1
    join play_record_tb p2 on p1.cid=p2.cid and p1.start_time between p2.start_time and p2.end_time
    group by p1.id, p1.cid) as table1
group by cid
order by max_peak_uv desc,cid
limit 3