From the below data set I need to find out the list of all dependent child of a parent and there level of relationship with the top most parent !! , Friends need your inputs!!
Sample dataset:
Table: Family
Input is top most parent: 1,7
Expected Output:
parent
| child
| level to parent
|
---|
1 | 2 | 1 |
1 | 3 | 2 |
1 | 4 | 3 |
7 | 8 | 1 |
7 | 9 | 2 |
| | |