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 whi
You can create a unique index (of one or more columns) and then use the MySQL replace command.
CREATE UNIQUE INDEX unique_name2 ON t2 (name2); REPLACE INTO t2 (name2) values ($name1); ...