mysql on duplicate key update get value from values
snippet in sql

mysql on duplicate key update

user8504

INSERT INTO t1 (a,b,c) VALUES (1,2,3)
  ON DUPLICATE KEY UPDATE c=3;
INSERT INTO t1 (a,b,c) VALUES (4,5,6)
  ON DUPLICATE KEY UPDATE c=9;

mysql on duplicate key update get value from values

user9373

INSERT INTO `tableName` (`a`,`b`,`c`) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE `a`=VALUES(`a`), `b`=VALUES(`b`), `c`=VALUES(`c`);

mysql on duplicate key update

user5106

UPDATE t1 SET c=c+1 WHERE a=1 OR b=2 LIMIT 1;