22

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.

Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
Mark
  • 833
  • 3
  • 10
  • 21

3 Answers3

35
update products set price = price * 2;
Annabel
  • 1,394
  • 14
  • 23
8

it's as easy as

UPDATE
  products
SET
  price = price*2;
oezi
  • 51,017
  • 10
  • 98
  • 115
5
UPDATE products SET price = price + price;

Didn't want to use multiplication :P

hjpotter92
  • 78,589
  • 36
  • 144
  • 183