Click here to Skip to main content
15,901,283 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have table with following structure for a tree:

Int => Id [Primary key]
varchar => Name
Int => ParantId [RefKey:-Ref to Id]

now i want to do is: by selecting any name, i need all the childs and sub child under the name that i selected and not from other names which are parallel or above the selected name, i wrote following query:

SELECT GROUP_CONCAT(o2.Id SEPARATOR ',')
    FROM organization AS o1, organization AS o2
    WHERE o1.Id = o2.ParentOrganizationId
        AND (o1.Id=3 OR o1.ParentOrganizationId =3));


but it is not working!! can any one help me?

thanks in advance:-)
Posted

1 solution

Hi Tushar,
HierarchyTree[^]
I hope it can give you a solution.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900