I want to do an INSERT SELECT query like this:
INSERT INTO `tableName` (SELECT * FROM `anotherTable`)
The problem is when it finds a duplicate
You need to add ON DUPLICATE KEY IGNORE :
INSERT INTO `tableName` (SELECT * FROM `anotherTable`) ON DUPLICATE KEY IGNORE
Info here-> http://dev.mysql.com/doc/refman/5.5/en/insert.html
Use INSERT IGNORE
INSERT IGNORE INTO `tableName` (SELECT * FROM `anotherTable`)