Re: Hotel Booking dates subquery
Date: Sat, 9 Nov 2002 18:54:40 +0100
Message-ID: <aqji3h$ipe$1_at_news.etf.bg.ac.yu>
Tip: I think your design is bad and I suggest you to re-design your tables
(if possible, of course) in such a way that will simplify your query...
Best wishes,
Damjan S. Vujnovic
University of Belgrade
School of Electrical Engineering
Department of Computer Engineering & Informatics
Belgrade, Yugoslavia
http://galeb.etf.bg.ac.yu/~damjan/
"Scotty" <invallid_at_invalid.spam> wrote: Im looking for a way to find empty rooms hotel between a certain date.
The room has four possible states; reserved, checked in, checked out, cancelled.
Now i'm not sure of the correct syntax but are the mechanics correct?
table with rooms id's -> Rooms
table with bookings -> Bookings
Select room_id
from rooms
where room_id !=
((select room_id
from booking
where room_status= reservation
and room_status= checked_in
and room_id =)
(select room_id
from booking
where date between start and finish))
Does that look about right? Received on Sat Nov 09 2002 - 18:54:40 CET
