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

Re: Full outer join?

From: Spencer <spencerp_at_swbell.net>
Date: Sat, 21 Jul 2001 21:23:19 GMT
Message-ID: <5ic07.64$p54.159853@nnrp3.sbc.net>

select ... from a,b where a.pk=b.pk(+)
union all
select ... from b where not exists (b.pk=a.pk)

"Vikas Agnihotri" <onlyforposting_at_yahoo.com> wrote in message news:77e87b58.0107021920.287b3c03_at_posting.google.com...
> 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
>
Received on Sat Jul 21 2001 - 16:23:19 CDT

Original text of this message

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