Mysql multiplication query

2019-04-05 10:17发布

问题:

I have a table called products containing a field called price and I simply want to double the price on every product. Could you give me a hand with an SQL statement I can run within PHP myAdmin please.

回答1:

update products set price = price * 2;


回答2:

it's as easy as

UPDATE
  products
SET
  price = price*2;


回答3:

UPDATE products SET price = price + price;

Didn't want to use multiplication :P