Created
April 24, 2021 13:56
-
-
Save memoryleak/16df25c6a4d3aafac7f014a69503329e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM booking | |
left join booking_room on booking.id = booking_room.booking_id | |
left join room on booking_room.room_id=room.id | |
where checkout < "2021-04-24"; | |
select * from room | |
left join booking_room on room.id = booking_room.room_id | |
LEFT join booking on booking_room.booking_id = booking.id | |
where (booking.checkout < "2021-04-24" or booking.checkout is null) or booking.checkin > "2021-04-24" order by booking.id asc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment