How can I update hundreds of rows at once?
Like: UPDATE table SET a = ? WHERE b = ? AND c = 1
UPDATE table SET a = ? WHERE b = ? AND c = 1
but for many rows. The ? parameters a
?
Another way would be to insert your key value pairs (all at once) into a temporary table then do something like this:
UPDATE table t SET t.a = (SELECT p.a FROM tmp p WHERE p.b = t.b) WHERE t.b IN (SELECT p.b FROM tmp p) AND t.c = 1