Home » SQL & PL/SQL » SQL & PL/SQL » query for count by minute
query for count by minute [message #3022] Fri, 30 August 2002 07:37 Go to next message
Joe
Messages: 138
Registered: November 1999
Senior Member
I have a table with three columns:

customer varchar2(15),
started date,
completed date

I need to create a report that will give me the max(count) per customer, minute (which doesn't exist), where started <= each minute of a day, and completed >= each minute of a day...I wrote a perl script to perform a query for each minute, but it is taking too long. I have nearly 3 million rows in this table on any given day. Any help is appreciated.
Re: query for count by minute [message #3028 is a reply to message #3022] Fri, 30 August 2002 11:37 Go to previous message
Dhiren
Messages: 43
Registered: July 2002
Member
u will need to have a small table which will have
a number column and have 60 rows entered in it
as 1.....60.
Then do an outer join with this table
to get the desired result.
Previous Topic: Installing a db
Next Topic: packaged procedure name identification (who am I)
Goto Forum:
  


Current Time: Thu Apr 25 06:21:16 CDT 2024