How can I check for duplicates before inserting into a table when inserting by select:
insert into table1 select col1, col2 from table2
I need
You can simply add IGNORE into your insert statement.
e.g
INSERT IGNORE INTO table1 SELECT col1, col2 FROM table2
This is discussed here