Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Combining outputs of queries!
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