You can get half-way there by not having to repeat the value:
INSERT INTO `tableName` (`a`,`b`,`c`) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE `a`=VALUES(`a`), `b`=VALUES(`b`), `c`=VALUES(`c`);
But you still have to list the columns.
More Related Contents:
- “INSERT IGNORE” vs “INSERT … ON DUPLICATE KEY UPDATE”
- MySQL Conditional Insert
- How to set initial value and auto increment in MySQL?
- How to do a batch insert in MySQL
- Get the new record primary key ID from MySQL insert query?
- On Duplicate Key Update same as insert
- Which is faster: multiple single INSERTs or one multiple-row INSERT?
- LAST_INSERT_ID() MySQL
- SQL – IF EXISTS UPDATE ELSE INSERT INTO
- MySql Table Insert if not exist otherwise update
- MySQL trigger On Insert/Update events
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- MySQL Error 1264: out of range value for column
- BULK INSERT in MYSQL
- How do I get the ID of multiple inserted rows in MySQL?
- MySQL trigger to update a field to the value of id
- How to insert data to MySQL with auto-incremented column(field)?
- How to insert values in table with foreign key using MySQL?
- MySQL Insert & Joins
- How to add a where clause in a MySQL Insert statement?
- Reserved word in column name – insert into MySQL [duplicate]
- MySQL LAST_INSERT_ID() used with multiple records INSERT statement
- MySQL – insert data from another table merged with constants
- Insert data into table with result from another select query
- Too many auto increments with ON DUPLICATE KEY UPDATE
- MySQL optimizing INSERT speed being slowed down because of indices
- MySQL – How to parse a string value to DATETIME format inside an INSERT statement?
- Incorrect integer value: ” for column ‘id’ at row 1
- “Unknown column in ‘field list'”, but column does exist
- Insert and set value with max()+1 problems