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

Home -> Community -> Usenet -> c.d.o.tools -> SQL Question

SQL Question

From: Fabio Oliveira Della Santina <fabio.oliveira_at_edb.ericsson.se>
Date: Thu, 19 Jul 2001 14:25:17 +0300
Message-ID: <3B56C39D.4B6F9B05@edb.ericsson.se>

Hi all,

I have a question about SQL.

I am building a report that use the SQL consilt below:

select to_char((submitted_on - to_char(submitted_on,'D') + 1),'MM-DD-YYYY') WeekDate,

                        SUM(DECODE(ir_state,'Deferred',1,0)),
                        SUM(DECODE(ir_state,'Development Release In Progres',1,0)),
                        SUM(DECODE(ir_state,'Development Release In Progress',1,0)),
                        SUM(DECODE(ir_state,'Document Fix In Progress',1,0)),
                        SUM(DECODE(ir_state,'Forwarded',1,0)),
                        SUM(DECODE(ir_state,'Passed By Retest',1,0)),
                        SUM(DECODE(ir_state,'Proposed For Lagomization',1,0)),
                        SUM(DECODE(ir_state,'SPE Release In Progress',1,0)),
                        SUM(DECODE(ir_state,'Software Fix In Progress',1,0)),
                        SUM(DECODE(ir_state,'Test In Progress',1,0)),
                        SUM(DECODE(ir_state,'Unassigned',1,0)),
                        SUM(DECODE(ir_state,'Under Investigation',1,0)),
                        SUM(DECODE(ir_state,'Withdrawn',1,0)),
                        SUM(DECODE(ir_state,'NULL',1,0)),
                        COUNT(identifier)
                                from defects
                                where (submitted_on >= to_date('05-01-2001','MM-DD-YYYY'))
                    group by (submitted_on - to_char(submitted_on,'D') + 1)
                    order by WeekDate;

And my result is a table grouped by week with number of ir_state by week.

The problem is: I need of the result acumulative of each week. For example, the result of the second row

the sum of ir_state of the second week more the result of first week.

Can Anybody help me ?

Thanks. Received on Thu Jul 19 2001 - 06:25:17 CDT

Original text of this message

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