I have two tables as described:
Table 1
Column A, Column B, Column C, Column D
Table 2
Column A, Column B, Column C, Column E, Column F
There is no relationship between the tables other than the data contained within them (table 2 is a temporary table). I want to delete rows from table one where they exist in table 2. However, it must be based on the combination of three columns. For example, delete in table 1 if there is a record in table two where columns A, B and C all match.
You're probably looking for an INNER JOIN DELETE.
DELETE a
FROM Table1 a
INNER JOIN Table2 b
ON a.ColumnA=b.ColumnA
AND a.ColumnB=b.ColumnB
AND a.ColumnC=b.ColumnC
(Or whatever the relationship is.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With