Mysql multiplication query

后端 未结 3 1039
傲寒
傲寒 2021-02-19 04:57

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 w

相关标签:
3条回答
  • 2021-02-19 05:27
    update products set price = price * 2;
    
    0 讨论(0)
  • 2021-02-19 05:34

    it's as easy as

    UPDATE
      products
    SET
      price = price*2;
    
    0 讨论(0)
  • 2021-02-19 05:48
    UPDATE products SET price = price + price;
    

    Didn't want to use multiplication :P

    0 讨论(0)
提交回复
热议问题