

UPDATE NewsletterQueue AS nq, Person AS p, NewsletterRecipient AS nr SET nq.NewsletterQueue_Send = 'false'
SELECT p.Person_Email, nr.NewsletterRecipient_Active, nq.Newsletter_ID, nq.NewsletterQueue_Send FROM NewsletterQueue AS nq, Person AS p, NewsletterRecipient AS nr
WHERE
	nr.Person_ID = p.Person_ID
	AND nr.NewsletterRecipient_Active = 'true'
	AND nq.Person_ID = nr.Person_ID
	AND nq.Newsletter_ID = 4
	AND p.Person_Email LIKE '%@example.com'
;


UPDATE Newsletter AS n SET n.NewsletterState_Code = 'running' WHERE n.Newsletter_ID = 4;