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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records in one table not in second table

Status
Not open for further replies.

mark1110

Programmer
Apr 20, 2005
85
US
If I have two tables with the same fields and want to find out all the records in the first table that are not in the second table, how would I do that?

Thanks,

Mark
 
look at "exception join" or at "not exists" on your reference manual or search the net for it.

If still required show us some code based on this, along with any errors you may still have.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
A starting point:
SELECT A.*
FROM firstTable A LEFT JOIN secondTable B ON A.PrimaryKey = B.PrimaryKey
WHERE B.PrimaryKey IS NULL

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top