Answers for "mysql insert update"

SQL
3

mysql insert on dupèlicate

INSERT INTO table_name(c1)
VALUES(c1)
ON DUPLICATE KEY UPDATE c1 = VALUES(c1) + 1;
Posted by: Guest on February-27-2020
3

mysql insert exists update

INSERT INTO table (column_list)
VALUES (value_list)
ON DUPLICATE KEY UPDATE
   c1 = v1, 
   c2 = v2,
   ...;
Posted by: Guest on August-03-2020
0

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`);
Posted by: Guest on December-28-2020

Code answers related to "mysql insert update"

Code answers related to "SQL"

Browse Popular Code Answers by Language