题解 | #查询连续入住多晚的客户信息?#
查询连续入住多晚的客户信息?
https://www.nowcoder.com/practice/5b4018c47dfd401d87a5afb5ebf35dfd
select c.user_id as user_id,c.room_id as room_id,room_type, datediff(checkout_time,checkin_time) as days from guestroom_tb g right join checkin_tb c on g.room_id=c.room_id and checkin_time like '2022-06-12%' where datediff(checkout_time,checkin_time)>1 order by days,room_id,user_id desc