Created
April 8, 2020 13:59
-
-
Save JAW-Dev/aab6ddf9d67173d9fd181fa47b6aea61 to your computer and use it in GitHub Desktop.
Low Stock
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.post_title as 'Name', pm.meta_value as 'SKU', pm2.meta_value as 'Stock' | |
FROM wp_posts p | |
INNER JOIN wp_postmeta pm | |
ON p.ID = pm.post_id | |
INNER JOIN wp_postmeta pm2 | |
ON p.ID = pm2.post_id | |
AND pm.meta_key = '_sku' | |
AND ((pm2.meta_key = '_stock' AND pm2.meta_value = '0' )) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment