Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: This SQL statement fails if joining table has no records.. why?

Re: This SQL statement fails if joining table has no records.. why?

From: Richard Foote <Richard.Foote_at_bigpond.com>
Date: Fri, 16 Aug 2002 09:11:40 +1000
Message-ID: <3D5C352C.1F37F5F0@bigpond.com>


Hi Phil,

The last and condition is negating the outer join.

Try and m.intMeetingID = 155 (+)

Cheers

Richard

Phil Powell wrote:
>
> select r.intCompanyRepID, r.strCompanyRepFirstName,
> r.strCompanyRepLastName,
> m.*
> from tblCompanyRep r, tblCompanyRepMeeting rm, tblMeeting m
> where r.intCompanyRepID = rm.intCompanyRepID (+)
> and rm.intMeetingID = m.intMeetingID (+)
> and m.intMeetingID = 155
>
> This SQL call will return no rows, however, I want it to return at
> least one row for m.* even if there are no rows in
> tblCompanyRepMeeting. tblCompanyRepMeeting is a joining table
> containing fields intMeetingID and intCompanyRepID that correspond to
> tblMeeting and tblCompanyRep respectively.
>
> If no rows exist that tie the two tables together I still want stuff
> to come back from tblCompanyRep and tblMeeting anyway. I can't figure
> out how to do that, even with two outer joins, which I thought would
> solve the problem.
>
> Anyone know what I should do?
> Thanx
> Phil
Received on Thu Aug 15 2002 - 18:11:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US