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: An SQL question , not easy ;-)

Re: An SQL question , not easy ;-)

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Wed, 15 Aug 2001 04:22:13 -0700
Message-ID: <F001.0036AF27.20010815041520@fatcity.com>

Pursuing Guy's method in a non-procedural way:

select

    ts.timestamp,
    count(*)
from

    (
    select

        to_date('1-jan-2001','dd-mon-yyyy') +
        (rownum / 1440) timestamp

    from short_narrow_table_of_numbers
    where rownum <= 1440
    ) ts,
    phone_calls
where

    ts.timestamp between pc.start_date and pc.end_date  and pc.start_date between

        to_date('1-jan-2001','dd-mon-yyyy')
        and
        to_date('2-jan-2001','dd-mon-yyyy')
group by

    ts.timestamp
;

Adjust constants to suit precision and resources.

Jonathan Lewis

Seminars on getting the best out of Oracle Last few places available for Sept 10th/11th See http://www.jlcomp.demon.co.uk/seminar.html

-----Original Message-----

To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> Date: 15 August 2001 11:42

Quick and dirty solution:

Pick a time and look for all calls which started before that time and ended after that time. That will tell you how many calls were in progress at that time.

Repeat this at, say, half hour intervals, and graph the results. This will show you a trend. Where it looks like a peak, try narrowing the band of time you are looking at. Alternatively, use curve fitting to find a peak value.

g

-----Original Message-----

Sent: Wednesday, August 15, 2001 11:21 AM To: Multiple recipients of list ORACLE-L

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 help !!!
Thanks a lot in advance !
Andrey.

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Andrey Bronfin
  INET: andreyb_at_elrontelesoft.com

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).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Guy Hammond
  INET: guy.hammond_at_avt.co.uk
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).

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Jonathan Lewis
  INET: jonathan_at_jlcomp.demon.co.uk

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 - 06:22:13 CDT

Original text of this message

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