Created
March 5, 2009 22:44
-
-
Save camwest/74612 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
EXPLAIN SELECT root_node.id, GROUP_CONCAT(children.id) as child_ids | |
FROM contents as root_node | |
LEFT JOIN contents as children ON root_node.id = children.parent_id AND children.parent_id = root_node.id AND children.content_type_id =6 | |
WHERE root_node.content_type_id = 2 | |
GROUP BY root_node.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment