统计直播各科目同时在线人数核心代码如下:select course_id, times, sum(tag)over(partition by course_id order by times)num from( select course_id, in_datetime as times, 1 as tag from attend_tb union all select course_id, out_datetime as times, -1 as tag from attend_tb order by course_id, times)a