Usar recipient NOT IN (SELECT ...)
y author NOT IN (SELECT ...)
para excluir a los participantes que coincidan con sus condiciones 1 y 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)
)
La condición en ces
tiene que estar en ON
cláusula para que obtenga sent_at = NULL
para artículos que no tienen filas coincidentes.