SQL update multiple rows with same value SQL update multiple rows with same value sql sql

SQL update multiple rows with same value


You can use the IN clause for this, which is easier to read (and possibly more efficient?) than building a giant OR list. Try something like:

UPDATE ibf_membersSET points = points + 500WHERE mgroup = 15AND id IN (5, 7, 10, 11, 16, 25);


Just add another condition to your WHERE clause:

UPDATE ibf_members SET points = points + 500 WHERE mgroup = 15 AND id IN (5, 7, 10, 11, 16, 25)