Reputation: 32878
How can I update multiple values in MySQL?
This didn't work:
UPDATE test SET list=0,
price= 0.00 cprice= 0.00 WHERE test.id =3232
Upvotes: 28
Views: 89054
Reputation: 10346
You need to put a comma between the two different values, for example:
UPDATE orders
SET listPrice = 0,
bloggerPrice = 0.00,
customerPrice = 0.00
WHERE orders.id =245745
Upvotes: 66
Reputation: 321588
You're missing a comma:
UPDATE orders SET
listPrice = 0,
bloggerPrice = 0.00,
customerPrice = 0.00
WHERE
orders.id = 245745
Upvotes: 10
Reputation: 82096
Try:
UPDATE orders
SET listprice=0, bloggerPrice=0.00, customerPrice=0.00
WHERE id=245745
Upvotes: 8