I have two tables (Table1 and Table2.) I want to delete all rows in table2 if the id exsits in table1
Code so far:
DELETE a.id, a.car, a.boat
FROM Table2 a
LEFT JOIN Table1 b ON b.id = a.id
tables:
- table 1:
id, car, boat - table 2:
id, car, boat(delete if ID is same value as ID in table1)
1 Answer