hi all,
i have a problem, please help me out to solve this issue,

i have to traverse a Tree from Given Root and i have to count its Left Childs And Its Right Childs.

I have a database which stores this all information.

A Root can have only TWO Childrens.

Please tell me how can i count ROOT(S), Left And Right Childs

In table im saving all this like this

Field Name : Assigned_Left_To (Left Child ID)
Field Name : Assigned_Right_To (Right Child ID)

please solve my problem and give me a function to solve this problem