Created
September 21, 2012 20:10
-
-
Save errkk/3763626 to your computer and use it in GitHub Desktop.
Term - taxonomy relationship SQL join for WP
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 * FROM wp_posts p | |
LEFT JOIN wp_term_relationships tr ON tr.object_id = p.ID | |
LEFT JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id | |
LEFT JOIN wp_terms t ON t.term_id = tt.term_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment