题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
select a.room_id room_id, room_name, count(distinct user_id) user_count from (select distinct user_id, room_id, in_time, out_time from user_view_tb where (in_time between '23:00:00' and '24:00:00') or (out_time between '23:00:00' and '24:00:00') ) a left join room_info_tb b on a.room_id = b.room_id group by 1,2 order by 3 desc