Created
November 28, 2021 22:04
-
-
Save nedgrady/34c01372313608e62d98029b7c9eb933 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 UnfulfilledReservation.Id, | |
PotentialGuest.Name, | |
UnfulfilledReservation.Start, | |
UnfulfilledReservation.Finish | |
FROM ReservationRequest UnfulfilledReservation | |
INNER JOIN Customer PotentialGuest ON PotentialGuest.CustomerId = UnfulfilledReservation.CustomerId | |
LEFT JOIN Booking ON Booking.CustomerId = PotentialGuest.CustomerId | |
WHERE UnfulfilledReservation.Start < GETDATE() | |
AND Booking.BookingId IS NULL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment