SELECT * FROM rooms WHERE roomID NOT IN (SELECT * FROM rooms r,reservation e WHERE r.roomID=e.roomID AND (checkout > ?) AND (check-in < ?));
this