I use PHP and Mysql.
This SQL works:
INSERT INTO products (id, title, description)
VALUES (10, 'value1', 'value2')
ON DUPLICATE KEY UPDATE
id=10,
title='value25',
description='value2'
My id is a primary key and therefor it works. The other fields are varchars.
My real case is a bit different. Look at this:
Type is introduced and together with sku it's unique.
id sku title description type
1 abc one
2 abc two
3 def one
So my "real" key is the sku that I want to use and it's not unique by its own. It can not be in my case. But together with type it is unique.
Look below and it might be more clear:
abc-one // Unique combination
abc-two // Unique combination
def-one // Unique combination
Is it possible to use a multi insert/update SQL query in this case?