By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,694 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,694 IT Pros & Developers. It's quick & easy.

Query to Determine which record is not part of a Master Record Table

P: n/a
Hi,
I need to compare if certain records are contained whithin a Master
Table.

The following tables illustrates the comparing tables and the required
Result

Master Table
============
Field1 Field2
1000 001
1000 002
1000 003
2000 001
3000 001

Comparing Table
===============
Field1 Field2
1000 001
1000 004
2000 002
3000 001

Resulting Table-which shows which record are not part of Master Tbl
===============
Field1 Field2
1000 004
2000 001

How do I perform this query?

Regards LC

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There's an error in the previous post the result should be:

Resulting Table-which shows which record are not part of Master Tbl
===============
Field1 Field2
1000 004
2000 002

I've trying to use "EXISTS" with no result:

Being: Master Table Name="tblMaster"
Comparison Table Name="tblComparison"

SELECT Field1, Field2 from [tblComparison]
WHERE NOT EXISTS
(Select Field1, Field2 from [tblMaster])

Select

Nov 13 '05 #2

P: n/a
did you try the find unmatched query wizard?

Basically it uses an outer join.

SELECT tblA...
FROM tblA LEFT JOIN tblB ON tblA.Field1=tblB.Field2
WHERE tblB.Field2 IS NULL;

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.