Skip to content

Instantly share code, notes, and snippets.

@felixzapata
Created March 23, 2014 10:34
Show Gist options
  • Save felixzapata/9721335 to your computer and use it in GitHub Desktop.
Save felixzapata/9721335 to your computer and use it in GitHub Desktop.
Show all terms from a taxonomy named 'taxonomy, from post with id 136
SELECT t.*, tt.* FROM ss_terms AS t
INNER JOIN ss_term_taxonomy AS tt ON (tt.term_id = t.term_id)
INNER JOIN ss_term_relationships AS tr ON (tr.term_taxonomy_id = tt.term_taxonomy_id)
WHERE tt.taxonomy IN ('taxonomy') AND tr.object_id IN (136)
ORDER BY t.name ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment