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

Home -> Community -> Usenet -> c.d.o.misc -> Re: join in SQL

Re: join in SQL

From: REIP Jean-Claude <jacari.consultant.noospaamm_at_skynet.be>
Date: 1997/11/06
Message-ID: <63suir$nna$1@news0.skynet.be>#1/1

Hi,
You need an outer join to do this.
Any time B is empty, you got "no rows .."

Try somewhat as

    select a.value AV, c.value, AC from a, c

    where (       (a.c_id = c.id)
                 OR exists (select 'X' from b
                                    where (b.c_id = c.id and b.a_id = a.id))

this method inhibit action of B in the first request and don't require A & C in the subquery.

HTH :-)

--
REIP Jean-Claude
Enlevez ".remove.this" de l'adresse (anti-spam)
jacari.consultant.remove.this_at_skynet.be
Gerard Le Comte wrote in message <346182F1.1700_at_sns.fr>...

>
>Consider now, that I want to know all group (a.value;c.value)
>and that B is empty.
>
>----
>select a.value AV, c.value, AC from a, b, c
>where
>((a.c_id = c.id)
> OR (b.c_id = c.id and b.a_id = a.id)
>);
>----
>
>the result is always "no row selected" even if this
>request don't return "no row.." :
Received on Thu Nov 06 1997 - 00:00:00 CST

Original text of this message

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