Created
April 7, 2020 01:36
-
-
Save csaborio001/327f75e3617e58ab44236511382226b7 to your computer and use it in GitHub Desktop.
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 | |
* | |
FROM | |
wp_posts | |
INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
LEFT JOIN ( | |
SELECT | |
wp_posts.ID | |
FROM | |
wp_posts | |
INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
WHERE (wp_postmeta.meta_key = 'smoker' AND wp_postmeta.meta_value = 'Yes') | |
) smoker on smoker.id = wp_posts.ID | |
WHERE | |
smoker.ID IS NOT NULL | |
AND wp_posts.post_type = 'volunteer' | |
AND wp_posts.post_status = 'publish' | |
AND(wp_postmeta.meta_key = '_state' | |
AND wp_postmeta.meta_value = 'available') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment