How to Delete from a Table where rows match in Another Table – MySQL
So you have a table where you want to delete a bunch of rows, based on a particular column being matched in another table.
This is easily achievable with MySQL.
The above SQL will delete all rows in TABLE1
that are found in TABLE2
.
But what if we need to limit which records are returned from TABLE2
?
That’s simple too. All we need to do is add a traditional WHERE
clause to our select statement.