Hello, I'm not sure how to properly format a query that I need to select some database information. I have two tables, one named "appts" and another "clients". They are linked by client_id. I'm trying to write a query that will show me clients that haven't had an appointment is "X" amount of "time units". I'm doing this like:
SELECT * FROM appts JOIN clients ON appts.client_id = clients.client_id WHERE DATE(appts.appt_date) < DATE_SUB( CURDATE(), INTERVAL 1 MONTH) GROUP BY appts.client_id;
This works great if they users have already had an appointment. The problem is that users that haven't had an appointment are not being returned by the query (which I get). My question is there any way to also return those clients that haven't had an appointment yet (return those clients that have not already been booked by my system).
I realize I could just select those also in a separate query, but it would be nice to have them as part this data set? Any ideas?
Thanks!
Greg