Extracting only records that are not identical

johnmerlino

Registered User.
Local time
Today, 03:49
Joined
Oct 14, 2010
Messages
81
Hey all,

I'm trying to pull records that don't match.

I have two tables:
TestForgotten
fullName
Atkins,Ernest
Bacchus,Marsula

KeepThese
f_fullname
Atkins,Ernest


Notice table 1 and tabel 2 both have Ernest, so I don't want to pull that record. But notice table 1 has a field name that's not in table 2. That's the field I want to get into another table. However the two queries below are pulling both records even though it should only be pulling unmatching ones.

I try this query:

Code:
SELECT DISTINCT TestForgotten.fullname INTO TheForgotten
FROM 
KeepThese, TestForgotten
WHERE (KeepThese.f_fullName <>TestForgotten.fullname);
and I try this query:
Code:
SELECT DISTINCT TestForgotten.fullname INTO TheForgotten
FROM KeepThese, TestForgotten
WHERE KeepThese.f_fullName NOT IN (TestForgotten.fullname);
Both of them produce results where names matched. I only want to produce results where names don't match.

Thanks for response
 

Users who are viewing this thread

Back
Top Bottom