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

Home -> Community -> Usenet -> c.d.o.server -> SQL or PL/SQL

SQL or PL/SQL

From: <vigi98_at_my-deja.com>
Date: Thu, 02 Dec 1999 11:41:32 GMT
Message-ID: <825ltc$2r5$1@nnrp1.deja.com>


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

Original text of this message

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