Creating delete query based on matching fields between two tables

  • Thread starter Thread starter DBGuy11
  • Start date Start date
D

DBGuy11

I'm sure there's already one if not several posts for this but I couldn't
any. I have two tables both the same serial code field. I want to a basic
delete from tableA where tableA and tableB have matching serial codes. I have
tried just joining the two table by the serial code field in a delete query
but no matter how I try to go about it nothing works.

Thanks in advance for any assistance you can provide on this issue.

DBGuy11
 
DELETE FROM tableA
WHERE tableA.SerialCode IN (SELECT DISTINCT SerialCode FROM tableB)
 
Back
Top