I have two tables t1 and t2. t1 has duplicated values. I need to insert all records from t1 to t2, but I don’t want duplicates to occur in t2. I tried the following command which seems to me correct and no syntax error when I run it but the problem, it has 0 effect. No records from t1 inserted in t2.
insert into test.t2 (name2)
select name1 from test.t1 where NOT EXISTS (select name2 from test.t2);
Can anybody help ?
OR