Delete Duplicates That Match Another Table

  • Thread starter Thread starter Bryan Hughes
  • Start date Start date
B

Bryan Hughes

Hello,

What is the best way to create a Delete Duplicates Query That Match criteria
from anoter table?

-Bryan
 
Hi,


The easiest solution is to make the SELECT query with the inner join and
once you have got the records to be deleted nicely selected, change the
query type from a SELECT to a DELETE query type.

One of the pitfall is to specify the table from which you delete the
records: have one, but just one table. with a tableName.* in the first
step (before changing the query type).

The solution you would get is only valid in Jet. For a more universal
solution, the query could be like:


DELETE FROM Table1 WHERE Table1.Key1 IN (SELECT Key1 FROM Table2)



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top