Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get List of Times Between Dates based on Interval

m.salahatFeb 22 2020 — edited Feb 23 2020

Hi,

I have one case hopefully some can help, the case as then following I have center which have diffrent time as be sample I need list of all times between different dates then user will choose one date / time

where I have one table Called Center have multi time and intervals, the goal is to write query to return below result without using any temp table "PL/SQL" only

Center 1

22-Feb-2020     Start Time 9:00 AM.     Close.  12:00 PM      Interval Time 30 Min

23-Feb-2020     Start Time 9:00 AM.     Close.  02:00 PM      Interval Time 60 Min

Result should be as below

22-Feb-2020  9:00 AM -  9:30 AM

22-Feb-2020  9:30 AM -  10:00 AM

22-Feb-2020  10:00 AM - 10:30 AM

22-Feb-2020 10:30 AM - 11:00 AM

22-Feb-2020 11:00 AM - 11:30 AM

22-Feb-2020 11:30 AM - 12:00 pM

23-Feb-2020 9:00 AM - 10:00 AM

23-Feb-2020 10:00 AM - 11: AM

23-Feb-2020  11:00 AM - 12 PM

23-Feb-2020 12:00 PM - 1:00 PM

23-Feb-2020 01:00 PM - 2:00 PM

This post has been answered by mathguy on Feb 23 2020
Jump to Answer
Comments
Post Details
Added on Feb 22 2020
10 comments
1,524 views