I need to check a record for duplicates before inserting. What is the best way to do this for a database having a large number of records without affecting the performance?
INSERT IGNORE INTO table will do the trick.
INSERT IGNORE INTO table
see http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
INSERT IGNORE INTO table
will do the trick.see http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html