Skip to content

Instantly share code, notes, and snippets.

@cubehrends
Created February 24, 2021 13:06
Show Gist options
  • Save cubehrends/12da3cf1c2744f119c1716abdc1a8b5e to your computer and use it in GitHub Desktop.
Save cubehrends/12da3cf1c2744f119c1716abdc1a8b5e to your computer and use it in GitHub Desktop.
UPDATE wp_postmeta AS sku
JOIN (SELECT post_id, meta_value FROM wp_postmeta WHERE meta_key = '_ts_gtin') AS gtin USING (post_id)
SET sku.meta_value = gtin.meta_value
WHERE sku.meta_key = '_sku'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment