题解 | #查询连续入住多晚的客户信息?#

查询连续入住多晚的客户信息?

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







全部评论

相关推荐

10-15 09:13
已编辑
天津大学 soc前端设计
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务