Top "On-duplicate-key" questions

ON DUPLICATE KEY UPDATE is an SQL feature in MySQL which allows a row to be updated instead on inserted in an INSERT query, if it would otherwise attempt to create a duplicate key in a unique index.

On Duplicate Key Update same as insert

I've searched around but didn't find if it's possible. I've this MySQL query: INSERT INTO table (id,a,b,c,…

mysql on-duplicate-key
PHP MYSQL UPDATE if Exist or INSERT if not?

I have no idea if this is even remotely correct. I have a class where I would like to update …

php mysql sql-update sql-insert on-duplicate-key
Is there a way to use ON DUPLICATE KEY to Update all that I wanted to insert?

I know that you can use ON DUPLICATE KEY UPDATE to update a certain value if there is a record …

mysql insert on-duplicate-key
MySQL LOAD DATA INFILE with ON DUPLICATE KEY UPDATE

For loading huge amounts of data into MySQL, LOAD DATA INFILE is by far the fastest option. Unfortunately, while this …

mysql load-data-infile on-duplicate-key
EF6 CodeFirst My [Key] Id Column is not auto-incrementing as an identity column should

I have several classes that I need to derive from a common base class which holds an Id. Ignoring the …

c# sql entity-framework code-first on-duplicate-key
Yii INSERT ... ON DUPLICATE UPDATE

I am working on a Yii project. How can I use the ON DUPLICATE feature of MySQL ( http://dev.mysql.…

php mysql yii on-duplicate-key yii-cmodel
Doctrine: ON DUPLICATE KEY UPDATE

How can I write an INSERT doctrine query with option ON DUPLICATE KEY UPDATE?

mysql pdo doctrine on-duplicate-key
PDO prepared statements for INSERT and ON DUPLICATE KEY UPDATE with named placeholders

I'd like to switch PDO INSERT and UPDATE prepared statements to INSERT and ON DUPLICATE KEY UPDATE since I think …

php pdo prepared-statement on-duplicate-key sqlbindparameter
update on duplicate key update

I have a table playerspoints that contains a shop id and a player's id, and a player's points. SHOP_ID | …

mysql sql-update on-duplicate-key
MySQL INSERT on duplicate key UPDATE with SELECT

I have a query like the following INSERT INTO connections (`c_id`,`in`,`out`,`ip`,`userID`) VALUES ( ( SELECT c_id …

mysql select on-duplicate-key