469,938 Members | 2,462 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,938 developers. It's quick & easy.

Help - Two Left Joins to exclude duplicates from two tables ...

i want to exclude email addresses which are in
newsletter_email_addresses which also appear in
mooky_private.sign_ups.email and mooky.newsletter_opt_outs.email.
my query seems to exclude the mooky_private.sign_ups.email but not the
mooky.newsletter_opt_outs.email. any idea why my second left join isn't
working?

thanks,
s7
SELECT
mooky.newsletter_email_addresses.id,
mooky.newsletter_email_addresses.email
FROM
mooky.newsletter_email_addresses
LEFT JOIN
mooky_private.sign_ups
ON
mooky.newsletter_email_addresses.email = mooky_private.sign_ups.email
LEFT JOIN
mooky.newsletter_opt_outs
ON
mooky.newsletter_email_addresses.email =
mooky.newsletter_opt_outs.email
WHERE
mooky.newsletter_email_addresses.newsletter_id = 46
AND
mooky.newsletter_email_addresses.email LIKE '%@%'
AND
mooky_private.sign_ups.email IS NULL
AND
mooky.newsletter_opt_outs.email IS NULL

Oct 30 '06 #1
0 3037

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Marek Kotowski | last post: by
3 posts views Thread by Prem | last post: by
3 posts views Thread by Ian Boyd | last post: by
3 posts views Thread by MostlyH2O | last post: by
8 posts views Thread by shawnews | last post: by
9 posts views Thread by TF | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.