Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

how to count number of left and right child in binary tree

$
0
0

i have two table like

1.mastertab

mid   email           ref.id      position

  1     a@a.com       0          admin

  2     b@b.com       1              L

  3     C@c.com       1              R

  4      d@d.com      2              L

2.Countstatus

Mid     Leftcount      RightCount

 1             0                     0

 2             0                     0

 3             0                     0

 4             0                     0

now i want to update each mid for it,s number of left child count in leftcount and same in rightcount using trigger but how to use it i don,t  know.

please help


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>