I have a couple of tables in a database.
I want to pull back a list of events with a particular category id that are after a certain date, or where the event doesn't have a date entry in the event_dates table.
I've tried something like this thinking it would work, but it didn't
SELECT * FROM events AS event, event_dates AS date
WHERE event.category_id = $category_id
AND (date.event_id = event.id AND date.date >= '$date' OR event.id NOT IN (SELECT event_id FROM event_dates))