I have 3 tables t1,t2 and tarchive, I want to transfer only records from t2 into tarchive that are not included in t1 and then delete from t2.
below is the solution I have but it doesn't work:
INSERT INTO tarchiv
WHERE (SELECT COUNT(t1.id) FROM t1 as a, t2 as b WHERE a.t1id = b.t2id) = 0;
DELETE FROM t2
WHERE (SELECT COUNT(idangeb0t) FROM t1 as a, t2 as b WHERE a.t1id = b.t2id) = 0;
can someone help me out with it?
