Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/12/2023 in all areas

  1. Then I think you want this method - using a LEFT JOIN to those bookings already made in the period and then the WHERE clause selects those that aren't matched SELECT r.room_id , r.number FROM room r LEFT JOIN room_booking_2 rb ON r.room_id = rb.room_id AND rb.departureDate > '2024-01-01' AND rb.arrivalDate <= '2024-01-05' WHERE rb.room_id IS NULL ORDER BY room_id; or an alternative method - using a subquery to find the rooms not available SELECT r.room_id FROM room r WHERE room_id NOT IN ( SELECT room_id FROM room_booking_2 rb WHERE departureDate > '2024-01-01' AND rb.arrivalDate <= '2024-01-05' );
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.