Last active
February 17, 2017 23:01
-
-
Save salase/8e007abebb86cd7489a686492cdaf5e9 to your computer and use it in GitHub Desktop.
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.id,tt.term_id | |
FROM ( | |
SELECT p.id | |
FROM `wp_posts` p | |
join `wp_term_relationships` tr on p.id=tr.object_id and p.post_type='post' | |
join `wp_term_taxonomy` tt on tr.term_taxonomy_id=tt.term_taxonomy_id and tt.taxonomy='category' ) | |
as p | |
JOIN wp_term_relationships tr ON tr.object_id = p.ID | |
JOIN wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id and tt.taxonomy = 'category' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment