Re: Count Hierarchical Data(Binary Tree) in MySQL?
Posted by:
Manivel P
Date: January 29, 2010 02:56AM
The Child Nodes count is coming as 0.
this query is not helping..
Any advise on this.
SELECT parent.id, Count(distinct child.id) - 1 AS 'Child Nodes'
FROM sb parent
JOIN sb child ON child.left_id BETWEEN parent.left_id AND parent.right_id
GROUP BY parent.id;
Subject
Views
Written By
Posted
4396
January 27, 2010 04:38AM
2764
January 27, 2010 10:19AM
Re: Count Hierarchical Data(Binary Tree) in MySQL?
2379
January 29, 2010 02:56AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.