Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: An SQL question , not easy ;-)
Andrey,
At first glance, I think this SQL statement gives you the answer. It gives you a count of the simultaneous calls for each call. If you like this, then all you have to do is find the row with the maximum count.
select a.call_start,a.call_end,count(*)+ 1 from pc a, pc b
where a.call_end >= b.call_start and a.call_start <= b.call_end and a.call_start <> b.call_start and a.call_end <> b.call_end and a.call_start < b.call_start
Chaim
Andrey Bronfin <andreyb_at_elrontelesoft.com> on 08/15/2001 06:20:40 AM
Please respond to ORACLE-L_at_fatcity.com
To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> cc: (bcc: Chaim Katz/Completions/Bombardier)
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-LReceived on Wed Aug 15 2001 - 12:08:35 CDT
(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: INET: Chaim.Katz_at_Completions.Bombardier.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).
![]() |
![]() |