Created
April 10, 2018 19:19
-
-
Save maycomayco/c48daafc6712d5ab5a5a235085e4988b to your computer and use it in GitHub Desktop.
Find Woocommerce product whit empty SKU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.ID, | |
p.post_title, | |
p.post_type, | |
pm.meta_value | |
FROM wp_posts p | |
LEFT JOIN wp_postmeta pm | |
ON pm.post_id = p.ID | |
AND pm.meta_key = '_sku' | |
WHERE p.post_type = 'product' | |
AND (pm.meta_value = '' | |
OR pm.meta_value IS NULL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment