题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
with temp as ( select room_id, count(distinct user_id ) as user_count from user_view_tb where in_time <= '23:59:59' AND out_time >= '23:00:00' group by room_id) select a.room_id, room_name, user_count from temp a join room_info_tb b on a.room_id=b.room_id order by user_count desc