Brug recipient NOT IN (SELECT ...)
og author NOT IN (SELECT ...)
at udelukke de deltagere, der matcher dine betingelser 1 og 2.
SELECT
hia.query_result_id,
hia.url,
hia.title,
hia.article_publication_day,
hia.media_name,
hia.author_full_name,
hia.author_first_name,
hia.author_last_name,
hia.author_email,
ces.sent_at
FROM
Hobby_ideas_articles hia
LEFT JOIN
Past_Customer_sent_messages ces
ON
hia.author = ces.recipient
AND ces.recipient NOT IN (
SELECT recipient
FROM Past_Customer_sent_messages
WHERE sent_at > DATE_SUB(NOW(), INTERVAL 3 HOUR)
)
WHERE
hia.hobby_id = HOBBY_ID_INPUT_I_HAVE AND
hia.author IS NOT NULL
AND hia.author NOT IN (
SELECT recipient
FROM Past_Customer_sent_messages
WHERE customer_id = CUSTOMER_ID_INPUT_I_HAVE
AND sent_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
)
Betingelsen på ces
skal være i ON
klausul, så du får sent_at = NULL
for artikler, der ikke har nogen matchende rækker.