select t1.room_id , room_name, user_count from ( select room_id,count(distinct user_id) as user_count from user_view_tb where substr(in_time,1,2)>='23' or substr(out_time,1,2)>='23' group by room_id )t1 inner join room_info_tb t2 on t1.room_id= t2.room_id order by 3 desc
in_time在23点之后或者out_time 在23点之后