duplicate key update mysql code example
Example 1: mysql insert on dupèlicate
INSERT INTO table_name(c1)
VALUES(c1)
ON DUPLICATE KEY UPDATE c1 = VALUES(c1) + 1;
Example 2: mysql on duplicate key update
UPDATE t1 SET c=c+1 WHERE a=1 OR b=2 LIMIT 1;