It seems that the only way to use UPDATE for multiple rows is CASE as
UPDATE posts SET rates = CASE
WHEN post_id = '44' THEN rates + 'X'
WHEN post_id = '33' THEN rates + 'Y'
WHEN post_id = '73' THEN rates + 'Z'
WHEN post_id = '63' THEN rates + 'X'
...
ELSE rates END
Consider a table with 1 million rows. This needs to loop over 1 million records to update e.g. 10 rows.
If we use single UPDATE for each UPDATE as
UPDATE posts SET rates = rates + 'X' WHERE post_id='44'
UPDATE posts SET rates = rates + 'Y' WHERE post_id='33'
UPDATE posts SET rates = rates + 'Z' WHERE post_id='73'
UPDATE posts SET rates = rates + 'X' WHERE post_id='63'
...
we will have 10 queries, but we do not loop over 999,990 other rows.
Which is the most efficient methods when the number of UPDATEing rows is significantly lesser than the total rows in the table?
One More Question: When we have ELSE rates END in the CASE; how mysql skips this record? Is a heavy task comparable with write?
Instead of asking which is most efficient, why did you not experiment using the available tools, such as EXPLAIN or profiling?
Just add a where clause to your update –