I got this table in my MySQL database, \'users\'. It has the fields \'id\' and \'value\'.
Now, I want to update lots of rows in this table with a single
Rather than doing case variable when value then ..., try doing case when condition then ... - like so:
case variable when value then ...
case when condition then ...
UPDATE users SET value = CASE WHEN id in (1,4) THEN 53 WHEN id = 2 THEN 65 WHEN id in (3,5) THEN 47 END WHERE id IN (1,2,3,4,5)