Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Combine 2 Queries

Author  Topic 

tmaiden
Yak Posting Veteran

86 Posts

Posted - 2010-06-01 : 13:38:03
I am trying to combine these queries by joins. Not looking to use a UNION. Thought this could be accomplised with a FULL OUTER JOIN. Please advise.

SELECT B.Field
FROM Base B
WHERE B.CreatedOn = '05/11/2010'

SELECT B.Filed
FROM Base B
INNER JOIN Table1 t1
ON t1.ID = B.ID
WHERE t1.ModifiedOn = '05/11/2010'

Thought this would work, but doesn't seem to.
SELECT B.Filed
FROM Base B
FULL OUTER JOIN Table1 t1
ON t1.ID = B.ID
WHERE t1.ModifiedOn = '05/11/2010' OR ISNULL(B.CreatedOn,'05/11/2010') = '05/11/2010'
   

- Advertisement -