题解 | 查询连续入住多晚的客户信息?
select * from ( select user_id, gt.room_id, room_type, datediff (checkout_time, checkin_time) days from test.checkin_tb ct join test.guestroom_tb gt on ct.room_id = gt.room_id where date_format (checkin_time, '%Y-%m-%d') > 2022 -06 -12 ) a where days > 1 order by days asc, room_id asc, user_id desc