Created
May 25, 2016 18:03
-
-
Save cezarpopa/d9ab16e34339fd955e4b261c8e03d191 to your computer and use it in GitHub Desktop.
WooCommerce empty sku check
This file contains hidden or 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