title: Traversing a Parent / Child Table?
body: <p>I have a Self-join(parent/child) table that forms a TreeView control. in this structure only leaf nodes has a [Percent] value(persists in table only for leafs). and parent nodes values calculated from children(average values of children = parent [Percent] value).<br/></p>
  
  <p>How to write a procedure or function to calculate every node [Percent] values? any suggestions? i am beginner in sql and not familiar enough in sql statements and could not find any suitable article in the web. thank you!</p>