INSERT … ON DUPLICATE KEY UPDATE syntax, you can find explanations on dev.mysql.com
Post from bogdan.org.ua
18th October 2007
To start: as of the latest MySQL, syntax presented in the title is not possible. But there are several very easy ways to accomplish what is expected using existing functionality.
There are 3 possible solutions: using INSERT IGNORE, REPLACE, or INSERT … ON DUPLICATE KEY UPDATE.Imagine we have a table:
CREATE TABLE `transcripts` (