clballas
asked on
exclude records in one table from another table
I have a table with certain customers that should be excluded from mailing. How do I join the full table to this table to provide a list with just those who should get the mailing? Thank you in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
LPurvis,
Both ways seem to work. Any reason to choose one over the other?
--clballas
Both ways seem to work. Any reason to choose one over the other?
--clballas
Opinion varies.
There's every chance that Jet would create an execution plan the same way for either.
It used to be felt that the Join would operate more efficiently - but as stated above this isn't necessarily so.
(I can't remember testing in recent history - but as a general rule I'll prefer the Join... and use In when it's required).
Simple answer - run them both - see if one's slightly faster. :-)
(It could well vary from recordset to recordset).
There's every chance that Jet would create an execution plan the same way for either.
It used to be felt that the Join would operate more efficiently - but as stated above this isn't necessarily so.
(I can't remember testing in recent history - but as a general rule I'll prefer the Join... and use In when it's required).
Simple answer - run them both - see if one's slightly faster. :-)
(It could well vary from recordset to recordset).
ASKER
Outstanding, clear answer! Thanks so very much!
You're very welcome. :-)
An alternative idea
Why dont u have a flag on your main table. This indicates whether they get included or not
Then u can just use this flag value
Doesnt answer your question but gives an alternative design and so the SQL is easier for you.
Oh well