MYSQL prestshop 1.7更新价格multistore



如何为给定产品id和商店id的所有行运行它:

一个表:ps_product_shop

<表类> id_product 价格 id_shop tbody><<tr>11112532212503

像这样?

UPDATE ps_product p, ps_product_shop ps 
SET p.price = p.price*25, ps.price = ps.price*25
WHERE p.id_product = 1 AND ps.id_product = 1 AND ps.id_shop = 2

我已经想到了,也许它会帮助别人:

UPDATE ps_product_shop AS sk SET 
price=(SELECT price FROM ps_product_shop
WHERE id_product = sk.id_product AND id_shop = '1')*27 WHERE (sk.id_shop='3');

所有行sk.id_shop='3'

相关内容

  • 没有找到相关文章

最新更新