Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Merging Records
Allan,
If the table structure is like this:
key1
key2
key3
col1
col2
col3
col4
col5
How about?
select key1, key2, key3, max(col1), max(col2), max(col3), max(col4),
max(col5)
from tableA
group by key1, key2, key3;
raghuvir
Allan Speir <r31055_at_email.sps.mot.com> wrote in article
<356303EB.FE179A57_at_email.sps.mot.com>...
> Hello,
>
> I'm currently trying to merge the results of several queries with the
> same record structure but containing different values.
>
> e.g.
>
> If I had 3 records as follows
>
> 1 2 3 a b d f
> 1 2 3 a b c d f
> 4 5 6 7 8 9 x y z
>
> I would like the result to be
> 1 2 3 a b c d f
> 4 5 6 7 8 9 x y z
>
> I tried the SQL set operator UNION but this seems only to work with
> records which are identical.
>
> Any help would be greatly approeciated.
>
> Regards,
>
> Allan
>
Received on Thu May 21 1998 - 00:00:00 CDT
![]() |
![]() |