I get customer ids for customers with sites that have appointments in 2011
SELECT customers.id
FROM customers
INNER JOIN sites ON customers.id = sites.customer_id
INNER JOIN appointments ON appointments.site_id = sites.id
WHERE YEAR(appointments.day) = 2011
I’m looking to get customers who don’t have any appointments in 2011. Confused on how to go about it.
A couple of ways:
or: