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: SQL: Full outer join?

Re: SQL: Full outer join?

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Mon, 02 Jul 2001 22:06:07 -0700
Message-ID: <3B4152BF.7EB6F7D6@exesolutions.com>

Vikas Agnihotri wrote:

> How can I write a SQL for the following 2-table join?
>
> Based on the PK, Table A has 0 or 1 matching values. Table B has 0 or
> 1 matching values.
>
> i.e. where A.pk = B.pk(+) or B.pk = A.pk (+)
>
> Is the above valid? Or do I need
>
> select... where a.pk=b.pk(+)
> union
> select .... where b.pk=a.pk(+)
>
> Any other efficient approaches?
>
> Thanks

Union or union all is an appropriate solution.

Daniel A. Morgan Received on Tue Jul 03 2001 - 00:06:07 CDT

Original text of this message

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