Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Grouping / totalling on field change
Ture Magnusson wrote:
> Hello all! I cannot figure out if/how I can do this with an SQL query.
>
> I would like a result which totals the weight for each quality whenever
> the quality changes (based on the order of the ID field).
>
> Original data:
> ID, QUALITY, WEIGHT
> 1, A, 10
> 2, A, 11
> 3, A, 12
> 4, B, 11
> 5, B, 19
> 6, A, 9
> 7, A, 14
> 8, C, 4
> 9, C, 7
>
> Desired result:
> ENDID, QUALITY, WEIGHT
> 3, A, 34
> 5, B, 30
> 7, A, 23
> 9, C, 11
>
> Best regards,
> Ture Magnusson
> Karlstad, Sweden
One more time:
The Wise Man (TK) says: "Analytics rock, analytics roll".
Cheers.
Carlos. Received on Wed Aug 09 2006 - 07:50:28 CDT
![]() |
![]() |