Bluehost.com Web Hosting $6.95

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

This is a discussion on Help - Two Left Joins to exclude duplicates from two tables ... within the MySQL Database forums, part of the Database Forums category; 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....


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-04-2006
starman7@hotmail.com
 
Posts: n/a
Default 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,
S.7.

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

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0