Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Aggregation query in Oracle
On 2005-07-19, bhaskarjain_at_gmail.com <bhaskarjain_at_gmail.com> wrote:
> have four queries Test, Test1, Test2, Test4 all of them having same
> number of columns and same datatype
>
>
> Test results in following columns
> Refrence_Num
> First_Name
>
>
> Test1 results in following columns
> Refrence_Num
> Middle_Name
>
>
> Test2 results in following columns
> Refrence_Num
> Last_Name
>
>
> Test3 reults in following columns
> Refrence_Num
> Nationality
>
>
> I have to join these four queries in such a way that I get following
> columns in the result and for Refrence_Num I have only one row having
> all the data.
>
>
> Refrence_Num
> First_Name
> Middle_Name
> Last_Name
> Nationality
>
>
> I don't want to create a temporary table or PL/SQL for this
Why don't you post the create table statements?
Anyway, use something like
select
Refrence_Num,
First_Name,
Middle_Name,
Last_Name,
Nationality
from
(select test) join (select test1) using (Refrence_Num) join (select test2) using (Refrence_Num) join (select test3) using (Refrence_Num);
hth
Rene
-- Rene Nyffenegger http://www.adp-gmbh.ch/Received on Tue Jul 19 2005 - 10:54:04 CDT