select room_id, room_name, count(distinct user_id) as user_count from user_view_tb join room_info_tb using(room_id) where in_time <= '24:00:00' and out_time > '23:00:00' group by 1, 2
看到很多人把整点的判断给忽略掉了