title: SQL: JOIN with nested queries
body: <p>I am trying to perform this join operation. As I am new to sql I am finding problems understanding the syntax and stuff.</p>
  
  <p>What do you think is wrong with the following query:</p>
  
  <pre><code>select top 1 * 
  from 
      (select * 
       from dbo.transaction_unrated 
          where transaction_date &gt;= '2012/05/01' 
              and transaction_date &lt; '2012/06/01' 
              and content_provider_code_id in (1)
      )   FULL OUTER JOIN 
      (select * 
       from dbo.transaction_rated 
          where transaction_date &gt;= '2012/05/01' 
              and transaction_date &lt; '2012/06/01' 
              and entity_id in (1) 
              and mapping_entity_id = 1)
      ) 
      ON dbo.transaction_unrated.cst_id = dbo.transaction_rated.unrated_transaction_id
  </code></pre>