Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question: SQL outer join
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..)
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