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: Combining outputs of queries!

Re: Combining outputs of queries!

From: Lothar Armbruester <lothar.armbruester_at_t-online.de>
Date: Wed, 10 May 2006 18:46:58 +0200
Message-ID: <e3t5e2$mog$02$1@news.t-online.com>


In article <4ceav9F15k9fnU1_at_individual.net>,

        Thomas Kellerer <BDHLDUUTPRWS_at_spammotel.com> writes:
>
>

[...]
>
> SELECT q1.commonField,
> q1.field1,
> q2.field2,
> q3.field3,
> q4.field4,
> q5.field5
> FROM (query1) q1, (query2) q2, (query3) q3, (query4) q4, (query5) q5
>

[...]

You surely want to join the subqueries in order to avoid a cartesian product of all rows.
You have to add something like

where

   q1.commonfield=q2.commonfield and
   q1.commonfield=q3.commonfield and
   q1.commonfield=q4.commonfield and
   q1.commonfield=q5.commonfield;

Thinking about outer joins could also make sense.

Hope that helps,
Lothar Received on Wed May 10 2006 - 11:46:58 CDT

Original text of this message

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