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 -> Oracle8i Left Join Question

Oracle8i Left Join Question

From: Neil Zanella <nzanella_at_garfield.cs.mun.ca>
Date: Tue, 20 Nov 2001 09:20:33 -0330
Message-ID: <Pine.LNX.4.30.0111200913480.1522-100000@garfield.cs.mun.ca>

Hello,

I know that Oracle 8i uses the notation = (+) for left Joins and that Oracle 9i uses the SQL LEFT OUTER JOIN syntax for this. Now I want to be able to do the left Join without using any of these two operators so as to obtain database independence in my implementation.

Thinking along these lines I notice that postgresql allows me to do the following but Oracle8 complains about NULL being an incompatible datatype with the other column above:

(SELECT A, B FROM T) UNION (SELECT A, NULL FROM T) The above is a simplification of what needs to be done to obtain the left outer join effect without using the = (+) or ANSI syntax.

Here is what I get: ORA-01790: expression must have same datatype as corresponding expression

Is there a way to circumvent this error in Oracle (other than using the join syntax)???

After all, why should NULL be incompatible with a column: even if the column is not null the outer joins are still allowed so...

Thanks,

Neil Received on Tue Nov 20 2001 - 06:50:33 CST

Original text of this message

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