Exclude Duplicate Data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • starman7@hotmail.com

    #1

    Exclude Duplicate Data

    Hello MySQL Gurus -

    I have 3 tables:

    all_customers, opt_out_custome rs, and opt_in_customer s

    Let's say there's an id column and an email_address column in each.

    I'm sending a newsletter - I want to send it to:

    all_customers except where opt_out or opt_in
    opt_in except where in all_customers (so as not to send it twice)


    I have to use MySQL 4.0. (no sub-selects, etc.)

    I had previously tried with a 'LEFT JOIN' but it only seemed to work to
    exclude one or the other (e.g. where NULL). Might a 'UNION' work here?

    Thanks for any info / examples.

    s7

Working...