Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do this simple query

Status
Not open for further replies.

ywenz

Programmer
May 29, 2003
21
0
0
US
Hi, I have two tables A and B, B's primary key is a foreign key in A. I want to do a query that returns all records in A where its foreign key value doesn't match up to any of B's primary keys' values. In other words, A has a corrupted or erroneous record. I've used NOT IN but it doesn't seem to be working. Thanks.
 
Do a left join and look for nulls

see find unmatched query
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top