- Uninteresting
- Misleading
- Offensive
- Repetitive
- Other
up vote
13down votefavorite
7
|
SUB-TREE WITHIN A TREE in MySQLIn my MYSQL Query to Create Table:
I have inserted a set of tuples (Query):
The inserted rows has following Tree-Hierarchical-Relationship:
I written a query to find relationship:
And output is:
[QUESTION] Instead of complete Hierarchical Tree, I need a
Please help me on this. If not query, a stored-procedure can be helpful. I tried, but all efforts were useless!
mysql sql stored-procedures
|
|||
migrated from stackoverflow.com Dec 8 '12 at 9:42This question came from our site for professional and enthusiast programmers. |
||||
| show 11 more comments
|
2 Answers 2
up vote
2down voteaccepted
|
I already addressed something of this nature using Stored Procedures : Find highest level of a hierarchical field: with vs without CTEs (Oct 24, 2011) If you look in my post, you could use the GetAncestry and GetFamilyTree functions as a model for traversing the tree from any given point. UPDATE 2012-12-11 12:11 EDTI looked back at my code from my post. I wrote up the Stored Function for you:
|
It my experience
I always got better answer from expert sides. And I think it was better decision to move question to Database Administrators. In all the cases, I am very thankful to stackoverflow and peoples who are active here. I really got solution for many problem that was very tough to find myself or any other web. – Grijesh Chauhan Dec 6 '12 at 16:43