Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I specify specific criteria with an outer join?

Status
Not open for further replies.

jenabl01

Technical User
Joined
Sep 26, 2001
Messages
3
Location
US
I have the following:

SELECT A.LOB, A.INVOICE, A.LINE, B.BI_ID, B.BI_TXT
FROM INV_LINE A, LINE_SB B
WHERE A.LOB = B.LOB (+)
AND A.INVOICE = B.INVOICE (+)
AND A.LINE = B.LINE (+)

I want to be able to specify a specific BI_ID (for those that have one), but lose the lines that don't have anything on the LINE_SB table.

Is this possible?
 

Add the following to the criteria.

AND (B.BI_ID = <criteria> Or B.LOB Is Null) Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
I just had to add the following:

b.invoice is null
b.line is null

and it works like a charm!

Thank you so much!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top