title: SQL Parent/Child recursive call or union?
body: <p>I can't seem to find a relevant example out there.</p>
  
  <p>I'm trying to return a sub-set of a table, and for each row in that table, I want to check how many children it has, and return that number as part of the result set.</p>
  
  <p>Parent Table Columns:
  PK_ID, Column1, Column2, FK1</p>
  
  <p>For each FK1 in result set, select count(*) from child_table.</p>
  
  <p>Final result set</p>
  
  <p>3, col1text, col2text, 1(child) <br>
  5, col1texta, col2texta, 2(child)<br>
  6, col1textb, col2textb, 0(child)<br>
  9, col1textc, col2textc, 4(child)<br></p>
  
  <p>I'm struggling with the best way to reference a column in the result set in another query, and then join them together again. Using T-sql</p>