I am having a table tbltestingtree representing the tree structure, Member_Id is the id of the member, Parent_Id represent the Parentid of that member , Lefts and Rights tells us that the member is attached to the left or right of the Parent.
**My problem is that i have to make a sqlquery that counts the total number of pared members for any particular parent ,**
Ex- currently member with id 1 has 3 pairs with id 2,3 and 4
currently member with id 2 has 1 pair with id 4
**My problem is that i have to make a sqlquery that counts the total number of pared members for any particular parent ,**
Ex- currently member with id 1 has 3 pairs with id 2,3 and 4
currently member with id 2 has 1 pair with id 4
Code:
Member_Id Parent_Id Lefts Rights 1 Null Null Null 2 1 1 Null 3 1 Null 1 4 2 1 Null 5 2 Null 1 6 3 1 Null 7 3 Null 1 8 4 1 Null 9 4 Null 1
Comment