Re: Oracle using Left Joins...

From: Paul A. Horan <paulh_at_nospam.twoplus.com>
Date: Tue, 10 Nov 1998 16:52:24 -0500
Message-ID: <uqqzlQPD#GA.306_at_ntawwabp.compuserve.com>


Using LEFT OUTER JOIN is ANSI syntax. I'm not sure which version of Oracle supports that as yet.
My Oracle syntax is a little rusty, but this gives the general idea:

SELECT

S.SectionNum,
S.UpSection,
S.Piece,
S.SECT_TYPE,
S.CONDUCTOR AS SectionConductor,
S.Phase,
S.MapName,
C.Conductor AS ConductorConductor

FROM SECTIONS S, Conductor C
WHERE S.Conductor (+) = C.Conductor
AND (S.SECTIONNUM <> '-1' OR S.SECTIONNUM IS Null) /* IS, not = */ ORDER BY S.SectionNum, S.Piece

Paul Horan
VCI
Springfield, MA

Steve Meier wrote in message <36472D16.7A4E355B_at_jcn1.com>...
>Greetings,
>
>I have an SQL statement that works fine in dBase and Access, but for
>some reason Oracle doesn't like it. The reference books I have don't
>talk much about Left joins exept that they use a (+) instead of the word
>join. Is there some mode that Oracle is in that it's not interpreting
>this statement correctly?
>
>If I remove the join and leave all the aliasing in the statement it
>works fine. In can use all fields from either table in a seperate
>select statement and it works ok. The error message I get is:
>
>37000: [Oracle][ODBC Oracle Driver][Oracle OCI]ORA-00933: SQL command
>not properly ended.
>
>Oracle is running on NT Server.
>
>SELECT S.SectionNum, S.UpSection, S.Piece, S.SECT_TYPE, S.CONDUCTOR AS
>SectionConductor, S.Phase, S.MapName, C.Conductor AS ConductorConductor
>FROM SECTIONS S LEFT JOIN Conducto C ON S.Conductor = C.Conductor WHERE
>S.SECTIONNUM <> '-1' OR S.SECTIONNUM = Null ORDER BY S.SectionNum,
>S.Piece
>
>Anyone have any ideas?
>
>Thanks,
>
> -Steve
>
Received on Tue Nov 10 1998 - 22:52:24 CET

Original text of this message