Created
October 9, 2009 17:19
-
-
Save bangpound/206182 to your computer and use it in GitHub Desktop.
Drupal 6 taxonomy SQL: select all terms with no children.
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 t.* FROM term_data t | |
INNER JOIN term_hierarchy h ON h.tid = t.tid OR h.parent = t.tid | |
WHERE t.vid = %d | |
GROUP BY t.tid | |
HAVING COUNT(t.tid) = 1 | |
ORDER BY weight,name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment