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 -> Join A to B via AB where AB may or may not join

Join A to B via AB where AB may or may not join

From: Don69 <vaillancourt.don_at_gmail.com>
Date: Fri, 14 Dec 2007 10:54:58 -0800 (PST)
Message-ID: <d1b54f11-c50b-4c43-9e00-1f28be22d901@e23g2000prf.googlegroups.com>


I have tables A and B which are joined in a binary relationship via AB.

I need to:

select *
from a, b

But the where cause must use the relationship defined in AB if one exists, otherwise join all B rows to every A row where the relationship doesn't exists.

Given:

A -> (A,B,C,D)
B -> (1,2,3,4)
AB -> (A1,A2,B3)

Should result in:
A1, A2, B3, C1, C2, C3, C4, D1, D2, D3, D4

Can anyone help with this. I know I've done it before, but can't remember how.

Thanks Received on Fri Dec 14 2007 - 12:54:58 CST

Original text of this message

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