title: Cross join on subquery
body: <p>Fee Table</p>
  
  <pre><code>FeeId(PK)managerId    amount    Type    
  1        50           100       1
  1        50           10000     39
  1        50           50000     2
  1        50           50000     3
  1        50           50000     4
  </code></pre>
  
  <p>Manager Table</p>
  
  <pre><code>FeeId(FK)Split    managerId
  1        70       68
  </code></pre>
  
  <p>Desired Results:</p>
  
  <pre><code>FeeId    managerId    amount    Type    
  1        50           30        1
  1        68           70        1
  1        50           3000      39
  1        68           7000      39
  1        50           15000     2
  1        68           35000     2
  1        50           15000     3
  1        68           35000     3
  1        50           15000     4
  1        68           35000     4
  </code></pre>
  
  <p>This dataset is just one record, there are many more FeeId's in my data. A cross join would not take this into account. I basically want to cross join each manager based on the feeId.</p>
  
  <p>The amount column is then recalculated to 70,30 for managerid 68,50 respectivly.</p>
  
  <p>How do I do a cross join on each subset: WHERE f.feeId = m.feeId to get the desired results?</p>
  
  <p>Example of cross join with incorrect results since the manager table will have more then 1 fee:</p>
  
  <pre><code>SELECT 
      f.feeId,
      (cast(m.split as decimal) / 100) * f.amount as amount
  FROM
      dbo.fee f
      CROSS JOIN dbo.manager m
  </code></pre>