I am having problem with selecting values from table a (id, room_name) where there are no corresponding events in table b (room_id, room_start, room_finish)
my query looks following
SELECT id, room_name FROM rooms WHERE NOT EXISTS (SELECT * FROM room_events WHERE room_start BETWEEN '1294727400' AND '1294729200' OR room_finish BETWEEN '1294727400' AND '1294729200')
table a contains multiple rooms, table b contains room events I am getting no results in case there is any event for any of the rooms within the timestamps. I am expecting all rooms having NO events.