Finding the records in one table that are not in another table

2004-07-10 Thread Jeff Gannaway
I have 2 tables - ProductsOLD and ProductsNEW. I need to find the records that are in the ProductsOLD table and are NOT in ProductsNEW (this will tell me which products have been discontinued). Here's some sample data: +==+ | ProductsOLD | +==+ + Vendor | ID |

Re: Finding the records in one table that are not in another table

2004-07-10 Thread Rory McKinley
Jeff Gannaway wrote: I have 2 tables - ProductsOLD and ProductsNEW. I need to find the records that are in the ProductsOLD table and are NOT in ProductsNEW (this will tell me which products have been discontinued). Here's some sample data: +==+ | ProductsOLD | +==+ +

Re: Finding the records in one table that are not in another table

2004-07-10 Thread mos
Jeff, You need to use a Left Join which will join rows from the second table even if the rows from the second table does not exist, and returns NULL for all column for the second table.. You then use the Where clause to check for a particular Table2.field that should exist (like Id