By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,240 Members | 791 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,240 IT Pros & Developers. It's quick & easy.

Re: HELP! OUTER JOIN QUERY

P: n/a
Greetings,

Left Join (outer join) queries are generally for excluding stuff.

select t1.* from tblx t1 Left Join tbly t2 on t1.ID = t2.ID and t1.fld1
= t2.fld1 and t1.fld2 = t2.fld2...
Where t2.ID Is Null And t1.fld1 = something and t1.date1 #somedate#
...

You may want to perform your comparisons fisrt and the do a left join on
the resulting subset.

Another thing you could do is to use a Where Not Exists clause for
excluding stuff. This will require an unique key column (usually an
Identity column - autonum)

Select t1.* from tblx t1 Where Not Exits (select * from tbly t2 Where
t2.ID = t1.ID)

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Aug 11 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Aug 11, 9:46*am, Rich P <rpng...@aol.comwrote:
Greetings,

Left Join (outer join) queries are generally for excluding stuff.

select t1.* from tblx t1 Left Join tbly t2 on t1.ID = t2.ID and t1.fld1
= t2.fld1 and t1.fld2 = t2.fld2...
Where t2.ID Is Null And t1.fld1 = something and t1.date1 #somedate#
..

You may want to perform your comparisons fisrt and the do a left join on
the resulting subset.

Another thing you could do is to use a Where Not Exists clause for
excluding stuff. *This will require an unique key column (usually an
Identity column - autonum)

Select t1.* from tblx t1 Where Not Exits (select * from tbly t2 Where
t2.ID = t1.ID)

Rich

*** Sent via Developersdexhttp://www.developersdex.com***
Thank you.
The problem is solved.
Aug 12 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.