title: Join two temp tables
body: <p>I want to join two temp tables.</p>
  
  <p>Here are my tables:</p>
  
  <pre><code>CREATE TABLE #Result ( Process varchar(50), SuccessCount int, FailureCount int)
  CREATE TABLE #SuccessResult ( Process varchar(50), SuccessCount int)
  CREATE TABLE #FailureResult ( Process varchar(50), FailureCount int)
  </code></pre>
  
  <p>I have some data in my tables, and here is my query:</p>
  
  <pre><code>INSERT INTO #Result (Process, SuccessCount, FailureCount)
  SELECT s.Process,s.SuccessCount,f.FailureCount
  FROM #SuccessResult s, #FailureResult as f
  INNER JOIN #SuccessResult on f.Process = #SuccessResult.Process
  </code></pre>
  
  <p>I'm getting this error: </p>
  
  <blockquote>
    <p>The multi-part identifier f.Process could not be found</p>
  </blockquote>
  
  <p>I'm using Microsoft SQL Server 2008.</p>
  
  <p>What am I doing wrong ?</p>