How to find Last Child (Node) of a parent
507047Sep 1 2008 — edited Sep 1 2008Hi All
I have following data:
PARENT CHILD
1 2
2 3
3 4
4 5
100 101
101 102
200 201
300 301
301 302
302 303
303 304
Now I need the output as below:
Parent Final Child
1 5
100 102
200 201
300 304
Which means, for the parent, it should start with immediate child and traverse through all subsequent parent-child relation ship and should find at ending with the last child for that group.
When the parent child relation is as below: i need to output 1 (first parent in the group) & 5 (last child in the group)
1 - 2 - 3 - 4 - 5
Quick solution could be helpful.
Thanks in advance,
Ram.