I am working with a scheduling database for events.
I am selecting from series of days and INNER JOINING them into the schedules parent "event". In my selection I want to make a condition where the selection has to be older than the CURDATE. Here is what I have tried but am getting an "improper use of grouping error"
SELECT MIN(event_schedule.event_day) as mindate, MAX(event_schedule.event_day) as maxdate, event.event_title
FROM event_schedule
INNER JOIN event ON event_schedule.event_id = event.id
WHERE MAX(event_schedule.event_day) < CURDATE()
GROUP BY event.id