Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL or PL/SQL
Hi all,
I'm not very good at doing SQL requests or PL/SQL scripts. Could you solve the following problem :
I've got three fields in a table : alarm_id,date-hour and severity. Severity is an integer between 1 and 3.
What I would like to obtain is what follows : for each period of 12h (from 6AM to 6PM, then from 6PM to 6AM) I would have the number of alarms per severity number.
Typically, it would give a table with the following fields :
date of the first part of the 12h period ; flag to indicate if the hour of the alarm is between 6AM and 6PM or not ; number of alarms of severity 1 ; number of alarms of severity 2 ; number of alarms of severity 3
Thank you very much for your responses.
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Dec 02 1999 - 05:41:32 CST
![]() |
![]() |