Exclude Duplicate Data

Hello MySQL Gurus -

I have 3 tables:

all_customers, opt_out_customers, and opt_in_customers

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
starman7 [ Mi, 22 November 2006 22:09 ] [ ID #1544236 ]
Datenbanken » mailing.database.mysql » Exclude Duplicate Data

Vorheriges Thema: Mysql or standard sql advanced manual
Nächstes Thema: 'Access denied for user 'root'@'localhost' (using password: NO)'