I know its quite challenging, Is there any sql specialist please kindly help me to solve this.
I Have hierarchyID
like below in NameHID
column. Its representing /NameID/dadID/MomID/
respectively. Which means the students fatherid and the motherID. My Table Name is students.
this is my sample NAMEHID
column
/2/8/5/
/5/11/12/
/8/7/9/
I need a output like
NameID | RecursiveLevel
2 0
5 1
7 2
8 1
9 2
11 2
12 2
From this Pic you can see the what is the RecursiveLevel. This tree representing something like ancestors of a specific node.
I need to show only the NameID and the Recursive level as out put.
if there Any other additional information need to do this?