题解 | 短视频直播间晚上11-12点之间各直播间的在线人数
短视频直播间晚上11-12点之间各直播间的在线人数
https://www.nowcoder.com/practice/38f5febc9dac4e9e84ed5891a3e4ca05
select
room_id,
room_name,
count(distinct user_id) as user_count
from
user_view_tb
left join room_info_tb using (room_id)
WHERE
in_time <= '23:59:59'
AND out_time >= '23:00:00'
group by
room_id,
room_name
order by user_count desc;
