Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Grouping / totalling on field change

Grouping / totalling on field change

From: Ture Magnusson <ture_at_turedata.se>
Date: 9 Aug 2006 04:25:34 -0700
Message-ID: <1155122734.545359.270770@m79g2000cwm.googlegroups.com>


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 Received on Wed Aug 09 2006 - 06:25:34 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US