I’m trying to retrieve rows from a venues table where there are no events placed on that day.
This is how I would retrieve an event:
SELECT
events.*,
venues.*,
party_types.PARTYTYPE
FROM events
INNER JOIN venues
ON events.VENUE_LOCATION = venues.ID
WHERE start_datetime >= '$DATE_START_SELECTED'
AND end_datetime < '$DATE_END_SELECTED'
GROUP BY events.ID
Where $DATE_START_SELECTED and $DATE_END_SELECTED are PHP variables that basically say Take all events between Date1 and Date2.
This is how I currently retrieve venues:
SELECT
venues.*
FROM venues
GROUP BY venues.VENUE_NAME
How would I go about retrieving all venues where there are no events held on that day (dependent on the PHP variables)?
Thanks everyone! 🙂
1 Answer