I have two databases with the same structure. How can i delete records from db1.table, that exists in db2.table?
db1 table: a - 1, a - 2, b - 1, c - 1
db2 table: a - 1, a - 2, c - 1, c - 2
result: b - 1
Update:
This query doesn't work
DELETE t1
FROM table t1
JOIN db2.table t2
WHERE t1.PrdID = t2.PrdID AND t1.CategoryID=t2.CategoryID
It gives me error
near "t1": syntax error:
db2 is attached to db1