Home » SQL & PL/SQL » SQL & PL/SQL » Time Increment
Time Increment [message #287280] Tue, 11 December 2007 16:33 Go to next message
lowcash75
Messages: 67
Registered: February 2006
Member
In a table I have start_time and end_time for a particular event. I need to break that out into 1/2hr increments till the end_time.

Example --
Event_id Start_Time End_Time
1 5/1/2007 10:00:00 AM 5/2/2007 8:00:00 AM

I need a sql that can translate this into several rows based on 1/2 hr increment.

1 5/1/2007 10:00:00 AM
1 5/1/2007 10:30:00 AM
1 5/1/2007 11:00:00 AM
...
...
...
1 5/2/2007 7:30:00 AM

Any suggestions on how to do this.

Thanks!
Re: Time Increment [message #287281 is a reply to message #287280] Tue, 11 December 2007 16:36 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
If I Recall Correctly (IIRC), I posted this solution less than 1 month ago.
I'm not about to re-invent the wheel, so you might want to go SEARCH this forum.

Wrong forum - try
http://www.dbforums.com/showthread.php?t=1624195

[Updated on: Tue, 11 December 2007 17:31] by Moderator

Report message to a moderator

Re: Time Increment [message #287339 is a reply to message #287280] Wed, 12 December 2007 00:37 Go to previous message
Michel Cadot
Messages: 68737
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
I showed it for every 5 minutes yesterday in "Avarege over 5 minutes" topic:
http://www.orafaq.com/forum/m/287136/102589/#msg_287136
Start with that.

Regards
Michel
Previous Topic: ORA-20000: ORU-10027: buffer overflow, limit of 1000000 bytes
Next Topic: Count Query in Having Clause
Goto Forum:
  


Current Time: Sun Feb 16 19:26:58 CST 2025