It is little urgent if any body how came frame to a query for the following tree so that I can get this result for th following tree
Structure Like this
ACCID ACCName Parent IsRoot Value
1 AAA 0 1 0
2 BBB 0 1 0
3 CCC 1 0 5
4 ddd 3 0 8
5 eee 4 0 4
Against this ACCID's I will be having some Counts here I need to know at the root level 0
ex., at the root level need to get the result as
Accid Value
1 17
2 0