Skip to content

Instantly share code, notes, and snippets.

@isheraz
Created September 2, 2016 07:35
Show Gist options
  • Save isheraz/8150f966ecadde61043ded0edf34c515 to your computer and use it in GitHub Desktop.
Save isheraz/8150f966ecadde61043ded0edf34c515 to your computer and use it in GitHub Desktop.
SELECT * FROM wp_posts p, wp_postmeta m1, wp_postmeta m2
WHERE p.ID = m1.post_id and p.ID = m2.post_id
AND m1.meta_key = 'key1' AND m1.meta_value = 'value1'
AND m2.meta_key = 'key2' AND m2.meta_value = "value2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment