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