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