开发者

Updating multiple values in MySQL

开发者 https://www.devze.com 2022-12-10 05:01 出处:网络
How can I update multiple values in MySQL? This 开发者_C百科didn\'t work: UPDATE test SET list=0, price= 0.00 cprice= 0.00 WHERE test.id =3232

How can I update multiple values in MySQL?

This 开发者_C百科didn't work:

UPDATE test SET list=0,
price= 0.00 cprice= 0.00 WHERE test.id =3232


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


You're missing a comma:

UPDATE orders SET 
    listPrice = 0, 
    bloggerPrice = 0.00, 
    customerPrice = 0.00 
WHERE 
    orders.id = 245745


Try:

UPDATE orders 
SET listprice=0, bloggerPrice=0.00, customerPrice=0.00 
WHERE id=245745
0

精彩评论

暂无评论...
验证码 换一张
取 消