1

So if I have a table with primary key consisted of one id, I can update multiple rows by writing

UPDATE tableA SET colA = 'newValue' WHERE id IN (1,3,5,7,9)

Can I do it somehow if I have primary key consisted of 2 columns? I would like to update multiple rows providing some kind of array of keys.

0

1 Answer 1

1

Yes, this is possible:

UPDATE 
  tablea SET cola = 'newValue' 
WHERE (id1,id2) IN ( (1,1), (2,2), (3,3) );

Not the answer you're looking for? Browse other questions tagged or ask your own question.