-3

i want to insert data to MySQL table but i want to check the duplicate same time when i insert data, if there is any duplicates then skip those data and insert the new data to the table, i want a way to do this with a query , please someone help

  • 2
    Possible duplicate of ["INSERT IGNORE" vs "INSERT ... ON DUPLICATE KEY UPDATE"](http://stackoverflow.com/questions/548541/insert-ignore-vs-insert-on-duplicate-key-update) – Naing Lin Aung Aug 19 '16 at 05:31

1 Answers1

0

You can check the records with a SELECT statement before inserting the data or you could just make one of the columns in your table UNIQUE.

sope
  • 86
  • 2
  • 9