Skip to content

Instantly share code, notes, and snippets.

@anton-roos
Created May 25, 2020 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anton-roos/a6442bedd3fd269e34bfe19ac2c3ba3b to your computer and use it in GitHub Desktop.
Save anton-roos/a6442bedd3fd269e34bfe19ac2c3ba3b to your computer and use it in GitHub Desktop.
Count duplicate WooCommerce Products SKUs
SELECT `meta_value`, `meta_key`, count(*)
FROM wp_postmeta WHERE meta_key LIKE '_sku'
GROUP BY `meta_value`
ORDER BY `count(*)` DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment