SQL to get cat ids of posts
-
I trying to get cat ids for posts with SQL outside the loop. The below SQL works, but I need a LEFT JOIN… not sure where…
SELECT terms.term_id, terms.name, term_taxonomy.description, term_taxonomy.count, term_taxonomy.term_taxonomy_id, posts.ID, term_relationships.object_id, term_relationships.term_taxonomy_id FROM terms INNER JOIN (term_taxonomy INNER JOIN (term_relationships INNER JOIN posts ON posts.ID = term_relationships.object_id) ON term_relationships.term_taxonomy_id = term_relationships.term_taxonomy_id) ON terms.term_id = term_taxonomy.term_id
suggestions?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘SQL to get cat ids of posts’ is closed to new replies.