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

Home -> Community -> Usenet -> c.d.o.server -> Re: Question: SQL outer join

Re: Question: SQL outer join

From: John S. Jones <jsj7_at_flash.net>
Date: Tue, 17 Nov 1998 22:04:30 -0600
Message-ID: <3652474E.4EF0271B@flash.net>


Your example should work. I tried a similar example and the multi-column outer join worked.
Are you trying to find null foreign key values? (just wondering why you are doing this..)



John S. Jones
InfoSphere, Inc.
Fort Worth, Texas

Sheldon Wang wrote:

> Hi,
>
> I have a question about using the Outer join in SQL statement. I know I can
> use the outer join on a single row in a table. However is it possible to
> apply the Outer join on multiple rows in one table? The following is my
> example:
>
> // outer joins with multiple rows (composite key). Is the following ok?
> // trans and detail are two tables.
>
> select
> a.cont_no,
> a.supertype_code,
> a.type_code,
> a.subtype_code,
> a.trans_no,
> a.region_code,
> b.value
>
> From
> trans a,
> detail b
>
> where
> a.cont_no= 'W8476-1-EN01/01NJ'
> and b.period = '01'
> and a.cont_no = b.cont_no(+)
> and a.supertype_code = b.supertype_code(+)
> and a.type_code = b.type_code(+)
> and a.subtype_code = b.subtype_code(+)
> and a.trans_no = b.irb_trans_no(+)
> and a.region_code = b.region_code(+)
>
> order by
> a.cont_no,
> a.region_code,
> a.trans_no,
> a.supertype_code,
> a.type_code,
> a.subtype_code
>
> // end of SQL
>
> I would appreciate your advice very much.
>
> Sheldon
Received on Tue Nov 17 1998 - 22:04:30 CST

Original text of this message

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