I am inserting some data into a table, but it occasionally clashes with other data in the table (ie. it has the same primary key).
I would like to be able to just overwrite this data if it is there, instead of having mysql send me an error message saying that there is a duplicate primary key. I know that I can just delete these values beforehand, but it would take a somewhat large query.
Is it possible to overwrite these values and suppress any warnings, or am I forced to remove these values?
I am inserting some data into a table, but it occasionally clashes with other
Share
Just a little cheatsheet.
Mysql has 3 different scenarios for handling unique key duplicates:
If you want to…
INSERT IGNOREREPLACE INTOON DUPLICATE UPDATE