Creating delete query based on matching fields between two tables

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
 
D

Douglas J. Steele

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top