title: SQL - Multiple criteria with a LEFT OUTER JOIN
body: <p>I am trying to do an OUTER JOIN, with multiple join conditions.  Here is my query (I will explain issue below):</p>
  
  <pre><code>SELECT ad.*, cp.P_A, cp.P_B, cp.P_C
  INTO #AggData3
  FROM #AggData2 ad
  LEFT OUTER JOIN #CompPriceTemp cp
  ON ad.PART=cp.Part_No
   and ad.[Month]=cp.[Month]
   and ad.[Year]=cp.[Year]
  GO
  </code></pre>
  
  <p>For each record in #AggData2, which is average price and volume by month for each part, I want to join the prices of the three competitors (A, B &amp; C).  Thus, I want to join based on Part, Month, and Year.  Because some competitors don't offer all parts, I am using a LEFT OUTER JOIN.  So, the resulting table (#AggData3), should have the exact same number of rows as the initial table (#AggData2), just with the three additional columns with competitor prices.</p>
  
  <p>However, the new table (#AggData3), has ~35,000 more rows than #AggData2.</p>
  
  <p>Any ideas why that is happening, and how to fix my query.</p>