I need an outer join

wgma

Registered User.
Local time
Today, 05:42
Joined
Nov 19, 2007
Messages
72
I have two queries that return similar data except one of the queries returns data over an expanded date range.

Q1 returns data from 2004 to 2007
Q2 returns data from 2004 to 2008

I need to be able to only return those records from Q2 that do not exist in Q1.

How can I do that?

Thanks.
 
Using a left outer join

Code:
SELECT Q2.*
FROM Q2 LEFT JOIN Q1 ON Q2.ID=Q1.ID
WHERE Q1.ID IS NULL

For "ID" use whatever common field(s) link your table
 
That did it. Thanks.
 

Users who are viewing this thread

Back
Top Bottom