I want to count number of all child nodes under any level of tree structure maintained in a table using adjacency model (parent-child key). Table structure and data looks l
The way you store your data will not allow for a simple query to get the total child count. But have a look at:
http://en.wikipedia.org/wiki/Nested_set_model
Where a query like this would be possible.