I am trying to update prices in WooCommerce based on SKU. I have written some SQL but getting error 'You can't specify target table 'wp_postmeta' for update in FROM clause'. Is there any way to do the following better?
UPDATE wp_postmeta SET meta_value = 144 WHERE
meta_key = '_regular_price' AND
post_id IN(SELECT post_id FROM wp_postmeta WHERE meta_key = '_sku'
AND meta_value = SKU1451E51);