|
-
Try this:
SELECT Parent.category_id, Parent.category_name, TreeBranch.ccount
FROM
category_tree Child,
category_tree Parent,
(SELECT COUNT(*) ccount
FROM
category_tree Child2,
category_tree Parent2
WHERE
Child2.StartBranch BETWEEN Parent2.StartBranch AND Parent2.EndBranch AND
Child2.category_id = Parent.category_id) TreeBranch
WHERE
child category_id = treebranch.category_id AND
(Child.StartBranch BETWEEN Parent.StartBranch AND Parent.EndBranch) AND
(Child.category_id=2)
ORDER BY TreeBranch
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|