Woocommerce查询对所有产品变型设置一次库存

时间:2018-09-25 09:43:20

标签: mysql sql wordpress woocommerce

通过此查询,我可以在这里看到我所有产品的变化:

SELECT p.id, mt.meta_value AS sku, m.meta_value AS stock, p.post_title AS title, p.post_content AS description, pt.meta_value AS price, wt.meta_value AS weight FROM mod379_posts p 
INNER JOIN mod379_postmeta m ON ( p.id = m.post_id ) 
INNER JOIN mod379_postmeta mt ON ( p.id = mt.post_id ) 
INNER JOIN mod379_postmeta pt ON ( p.id = pt.post_id ) 
INNER JOIN mod379_postmeta wt ON ( p.id = wt.post_id ) 
WHERE p.post_type = 'product' AND m.meta_key = '_stock' AND mt.meta_key = '_sku' AND pt.meta_key = '_price' AND wt.meta_key = '_weight'

如何通过一个SQL查询将所有产品的库存设置为350?

0 个答案:

没有答案