I have a table Cart with ItemID and UserID as primary key, with a quantity column. I want to increase the Quantity by the value of the inserted Quantity when inserted is a duplicate. I know it use INSTEAD OF INSERT
in some way but actually writing it is above my abilities.
For example:
Inserted UserID 1, ItemID 1, Quantity 10
Cart UserID 1, ItemID 1, Quantity 2
Result UserID 1, ItemID 1, Quantity 12