title: Update in child table, only one value got updated
body: <p>Below I am trying to update value of a parent table from child table and counting matching values. Tables in my db:</p>
  
  <ol>
  <li><p><code>issue_dimension</code> with id = issue_id and have column accno.</p></li>
  <li><p><code>star_schema</code> with id star_id,this Child column have fk issue_id and column book_frequency</p></li>
  </ol>
  
  <p>The book_frequency need to match the count of each accno in parent table , I tried this </p>
  
  <pre><code>update [test1] .[dbo] .star_schema 
  set [book_frequency] = (
      select top 1 COUNT([issue_dimension].ACCNO)as book_frequency 
      from issue_dimension 
      group by ACCNO having (COUNT(*)&gt;1) and 
          issue_dimension.ACCNO = star_schema .ACCNO
  )
  </code></pre>
  
  <p>It only updates only 1st value count issue_dimension. I need to count every accno in issue_dimension and update it to matching accno of star_schema.
  I never did update by joining two or more tables , can anyone help in this with joins </p>