mysql insert on duplicate key update id as code example
Example 1: mysql on duplicate key update get value from values
INSERT INTO `tableName` (`a`,`b`,`c`) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE `a`=VALUES(`a`), `b`=VALUES(`b`), `c`=VALUES(`c`);
Example 2: mysql on duplicate key update
UPDATE t1 SET c=c+1 WHERE a=1 OR b=2 LIMIT 1;