Mark
Mark

Reputation: 833

Mysql multiplication query

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.

Upvotes: 22

Views: 30258

Answers (3)

hjpotter92
hjpotter92

Reputation: 80639

UPDATE products SET price = price + price;

Didn't want to use multiplication :P

Upvotes: 5

oezi
oezi

Reputation: 51807

it's as easy as

UPDATE
  products
SET
  price = price*2;

Upvotes: 8

Annabel
Annabel

Reputation: 1414

update products set price = price * 2;

Upvotes: 35

Related Questions