Hi ,
I want to write a query which gives me tree structure as each node which has children should be displayed with its entire structure.Let me explain ....
1.I have hierarichal data for which I used connet by clause and I am getting tree structure.
2.Now I want to perform task as(in front end):I will have list of all nodes, I will select any one of node and it should show me tree after that node (considering start with clause with that selected node).
e.g.
T1
|_T2
|_T3 and T4
|_T31 |_T41
3.When I select T2,it should show me structure as T2,T3(with children) and T4 (with children)
4.when I select T3 then it should show me T3 and T31.
5.This is achieved with when I write start with = 'T2' but instead of this I want each node with its own tree.I want my query returning output as:
child_id Parent_id Node
T1 -1 T1
T2 T1 T2
T3 T2 T2
T31 T3 T2
T4 T2 T2
T41 T4 T2
T3 T2 T3
T31 T3 T3
T4 T2 T4
T41 T4 T4
Can anyone help in this?
Regards
KGP
I want to write a query which gives me tree structure as each node which has children should be displayed with its entire structure.Let me explain ....
1.I have hierarichal data for which I used connet by clause and I am getting tree structure.
2.Now I want to perform task as(in front end):I will have list of all nodes, I will select any one of node and it should show me tree after that node (considering start with clause with that selected node).
e.g.
T1
|_T2
|_T3 and T4
|_T31 |_T41
3.When I select T2,it should show me structure as T2,T3(with children) and T4 (with children)
4.when I select T3 then it should show me T3 and T31.
5.This is achieved with when I write start with = 'T2' but instead of this I want each node with its own tree.I want my query returning output as:
child_id Parent_id Node
T1 -1 T1
T2 T1 T2
T3 T2 T2
T31 T3 T2
T4 T2 T2
T41 T4 T2
T3 T2 T3
T31 T3 T3
T4 T2 T4
T41 T4 T4
Can anyone help in this?
Regards
KGP
Comment