title: Help for a Sql statement
body: <p>Hy at all, today is the day of ...question. 
  I've a single table, with a relation master-detail like this: </p>
  
  <pre><code>RecordID    MasterID   Field1 Field2 .... NrDetail
  1           0          xxx     yyyy       1
  2           0          aaaa     bbbb      2
  3           1          hhhhh   ssss       0
  4           2          eee     sssss      0
  5           2          jjj      hhhh      0
  </code></pre>
  
  <p>As you can see, NrDetail contain the total of "child record". 
  Unfortunately, i've to create this field... and i would like to write it in my table.
  So my SQL question is: how to do this type of SQL to write the field NrDetail ? </p>
  
  <p>Something like: </p>
  
  <pre><code>UPDATE table SET NrDetail= 
    (SELECT COUNT(*) as Total FROM table WHERE MasterID= RecordID) 
  </code></pre>
  
  <p>But i think there's some mistake... </p>
  
  <p>Thank you in advance !</p>