Query [message #371348] |
Thu, 05 October 2000 13:28 |
Salman Mohammed
Messages: 2 Registered: October 2000
|
Junior Member |
|
|
I have a table with fields
id modified_date, status, group, duration
lets say the sample values are
265827 9/12/00 6:48:33 PM 2 Mt Prospect IL 23
If it can be written in any analytic functions that will be great.
Thanks in advance
Salman
265827 9/12/00 7:10:25 PM 1 NNOC-Tel TRAC 24
265827 9/13/00 1:19:42 AM 2 NNOC-Tel TRAC 45
265827 9/13/00 1:20:01 AM 2 NNOC-Tel TRAC 43
265827 9/13/00 1:30:26 AM 4 Mt Prospect IL 55
265827 9/13/00 1:33:01 AM 2 NNOC-Tel TRAC 445
265827 9/13/00 1:34:38 AM 5 Mt Prospect IL 88
I want to group by group, status for duration field but I want the duration to be summed up only until the next status change. So in this case the result will be
2 Mt Prospect IL 23
1 NNOC-Tel TRAC 24
2 NNOC-Tel TRAC 88
4 Mt Prospect IL 55
2 NNOC-Tel TRAC 445
5 Mt Prospect IL 88
The group by status, group will sum up all the same staus, group combinations
so we will get
2 Mt Prospect IL 23
1 NNOC-Tel TRAC 24
2 NNOC-Tel TRAC 533
4 Mt Prospect IL 55
5 Mt Prospect IL 88
Thanks in advance
Salman
|
|
|