select v.room_id, room_name, count(distinct user_id) user_count
from user_view_tb v
join room_info_tb r using(room_id)
where in_time <= '24:00:00' and out_time >='23:00:00'
group by v.room_id, room_name
order by user_count desc;
时间范围比较重要