Home > Software design >  mysql batch update process
mysql batch update process

Time:01-14

I need to batch update balances of some users in members table, how should mysql query be?

MembersArray = array(1,3,4);
AmountToBeAdded = 10;

members

id. balance
1.  45
2.  15
3.  0
4.  120
5.  80

Thanks already for your help

CodePudding user response:

UPDATE members SET balance = balance   10
WHERE members.id IN(1,3,4)
  • Related