Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL Question
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