uksarkar
3 days ago
133
11
Laravel

What's wrong with my sql query?

Posted 3 days ago by uksarkar
SELECT
  *
FROM
  `rooms`
WHERE
  NOT EXIST (
    SELECT
      *
    FROM
      `reservation_nights`
    WHERE
      `rooms`.`id` = `reservation_nights`.`room_id`
      JOIN `reservations` ON `reservation_nights`.`reservation_id` = `reservations`.`id`
      AND `reservations`.`status` NOT IN ('CANCEL')
  );

Please sign in or create an account to participate in this conversation.