Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to make 2 rows into 1 row?
julio wrote:
> We have 2 rows of data. They are for the same item but have different data
> and we want 1 row. Does Sajar know?
>
> Terminal rating1 rating2
> 1234 23 34
>
> Terminal addr prior adv
> 1243 54 67 39
>
> we want
>
> Terminal rating1 rating2 addr prior adv
> 1243 23 34 54 67 39
>
> Julio and Colin and Lyse
>
> See my babies at
>
> http://www.geocities.com/colin_and_lyse/colin_lyse.html
It can not be done with the sample data you provided above.
If one assumes a touch of dyslexia however; and the first Terminal should be 1243, then this is a possible solution:
SELECT terminal, sum(rating1), sum(rating2), sum(addr), sum(prior), sum(adv)
FROM table
GROUP BY terminal;
Daniel Morgan Received on Tue Jul 02 2002 - 14:52:09 CDT