Follow up to Update multiple rows in 1 column in MySQL.
What is the most efficient query for updating multiple rows in 2 columns?
UPDATE example_table SET variable1 = 12 WHERE id=1;
UPDATE example_table SET variable2 = 'blue' WHERE id=1;
UPDATE example_table SET variable1 = 42 WHERE id=2;
UPDATE example_table SET variable2 = 'red' WHERE id=2;
UPDATE example_table SET variable1 = 32 WHERE id=3;
UPDATE example_table SET variable2 = 'yellow' WHERE id=3;
Using case
seems to be the most efficient, but how would I do it with multiple values being set at one time?