Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> OLAP question
Hi all,
I have a dataset relating to equipment up/downtime. Example :
equipment date_time status delta_secs
A1 01-JAN-2004 00:00:00 down 15 A1 01-JAN-2004 00:00:15 down 20 A1 01-JAN-2004 00:00:35 up 600 A1 01-JAN-2004 00:10:35 down 25 A1 01-JAN-2004 00:11:00 up 1500
I would like to have an overview of downtimes like :
...
A1 01-JAN-2004 00:00:00 35 secs A1 01-JAN-2004 00:10:35 25 secs
Can I do this with analytic functions ? When I start with something like :
select equipment,
date_time, sum(delta_secs) over (partition by equipment, status order byequipment, date_time)
then of course I get something like :
A1 01-JAN-2004 00:00:00 35 secs A1 01-JAN-2004 00:10:35 60 secs
(the second downtime is added to the first).
Am I missing something obvious ?
mvg/regards
Jo
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Tue Mar 02 2004 - 10:49:35 CST
![]() |
![]() |