SQL: JOIN with nested queries

Viewed 51080

I am trying to perform this join operation. As I am new to sql I am finding problems understanding the syntax and stuff.

What do you think is wrong with the following query:

select top 1 * 
from 
    (select * 
     from dbo.transaction_unrated 
        where transaction_date >= '2012/05/01' 
            and transaction_date < '2012/06/01' 
            and content_provider_code_id in (1)
    )   FULL OUTER JOIN 
    (select * 
     from dbo.transaction_rated 
        where transaction_date >= '2012/05/01' 
            and transaction_date < '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
1 Answers
Related