The following SQL code comes back with everything selected being NULL and the event_size being 0. My tables are set up correctly for the following criteria. What am I doing wrong here? Thank you for your help
SELECT table_one.event_id AS event_id, table_one.event_name AS event_name, table_one.event_address AS event_address, COUNT( table_two.user_id ) AS event_size
FROM table_one
JOIN table_two
ON table_one.event_id = table_two.event_id
WHERE (
table_one.event_start_date = '5/10/2012'
OR table_one.event_mid_date = '5/10/2012'
OR table_one.event_end_date = '5/10/2012'
)
ORDER BY event_size DESC
Try adding a group by clause:
This should do what you want.