Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql on duplicate key update

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;
Comment

mySql on duplicate key update

INSERT INTO table (column_list)
VALUES (value_list)
ON DUPLICATE KEY UPDATE
   c1 = v1, 
   c2 = v2,
   ...;
Comment

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`);
Comment

mysql on duplicate key update

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

PREVIOUS NEXT
Code Example
Sql :: postgres sum when 
Sql :: mssql server port 
Sql :: oracle sql generate list of days 
Sql :: sql select non unique 
Sql :: sql last time database was accessed 
Sql :: table structure in sql 
Sql :: checking data type in sql server 
Sql :: oracle list primary key 
Sql :: declare or use variable in snowflake 
Sql :: docker add mysql to image 
Sql :: oracle all dates between two dates 
Sql :: change schema in sql server 
Sql :: mysql not empty 
Sql :: sql query inner join 3 tables 
Sql :: mysql best tutorial for beginners 
Sql :: mysql fetch all data 
Sql :: sql order by with where 
Sql :: sql get month and year from date 
Sql :: php delete database 
Sql :: mysql where in maintain order group_concat 
Sql :: SELECT DISTINCT on one column, with multiple columns returned, ms access query 
Sql :: change schema of all tables postgres 
Sql :: how to comment in sql 
Sql :: mysql create pool 
Sql :: mysql delete older duplicates 
Sql :: like query 
Sql :: select only unique values from and to current table 
Sql :: oracle sql developer 
Sql :: pl sql search saurce code 
Sql :: how to check which table has data in mysql 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =