Skip to content

Instantly share code, notes, and snippets.

@nedgrady
Created November 28, 2021 21:49
Show Gist options
  • Save nedgrady/934543f32bd03fb21929e148d8c9b59a to your computer and use it in GitHub Desktop.
Save nedgrady/934543f32bd03fb21929e148d8c9b59a to your computer and use it in GitHub Desktop.
SELECT R.Id,
C.Name,
R.Start,
R.Finish
FROM ReservationRequest R
INNER JOIN Customer C ON C.Id = R.CustomerId
LEFT JOIN Booking B ON B.CustomerId = C.Id
WHERE R.Start < GETDATE()
AND B.BookingId IS NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment