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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: FW: An SQL question , not easy ;-)

Re: FW: An SQL question , not easy ;-)

From: Jan Pruner <jan_at_pruner.cz>
Date: Wed, 15 Aug 2001 03:32:43 -0700
Message-ID: <F001.0036AF0E.20010815034523@fatcity.com>

  1. Create table CC with 2 fields: DT DATE, CALL_COUNT NUMBER .
  2. Fill table CC with tuples with DT started from MIN(CALL_START) up to MAX(CALL_END) and CALL_COUNT = 0. Step of DT value is 1 minute (or second = 36mil tuples/year).
  3. for every tuple in a table of phone calls update table CC and set CALL_COUNT = CALL_COUNT + 1 WHERE DATE >= CALL_START AND DATE <= CALL_END .
  4. select max(call_count) from CC.

It's very lazy :-))), but you will get right number.

 Jan Pruner

Dne st 15. srpen 2001 12:40 jste napsal(a):
> Dear gurus !
> I have a table of phone calls , 2 fields : CALL_START DATE ,
> CALL_END DATE .
> I need an SQL statement or a PL/SQL block to calculate the maximum
> number of SIMULTANIOUS phone conversations.
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Jan Pruner
  INET: jan_at_pruner.cz

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Aug 15 2001 - 05:32:43 CDT

Original text of this message

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