Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: join in SQL
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>...Received on Thu Nov 06 1997 - 00:00:00 CST
>
>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.." :
![]() |
![]() |