PL/SQL Sum by hour

Posted by Steve on Stack Overflow See other posts from Stack Overflow or by Steve
Published on 2010-05-06T18:06:29Z Indexed on 2010/05/06 18:08 UTC
Read the original article Hit count: 312

Filed under:
|
|
|

Hi,

I have some data with start and stop date that I need to sum. I am not sure how to code for it.

Here are is the data I have to use:

STARTTIME,STOPTIME,EVENTCAPACITY

8/12/2009 1:15:00 PM,8/12/2009 1:59:59 PM,100

8/12/2009 2:00:00 PM,8/12/2009 2:29:59 PM,100

8/12/2009 2:30:00 PM,8/12/2009 2:59:59 PM,80

8/12/2009 3:00:00 PM,8/12/2009 3:59:59 PM,85

In this example I would need the sum from 1pm to 2pm, 2pm to 3pm and 3pm to 4pm

Any suggestions are appreciated.

Steve

© Stack Overflow or respective owner

Related posts about plsql

Related posts about Oracle