I have two tables, TableA and TableB, and each has a field called ID.
I want to delete all the records in TableA where the ID matches a record in TableB.
I try to do this command, but TableB is not found
DELETE FROM TableA WHERE TableA.id=TableB.id;
You can’t reference TableB on
WHEREbecause that table was not joined. But on this case you don’t even need aJOIN, use this: