Hello There,
I have a requirement to split a day into 1 hour wise (which includes hour, minutes and seconds) by each row.
The user will pass as a parameter P_DAY (Format: DD-MMM-YYYY), and based on input parameter the sql query should generate the rows as in the output
Eg. P_DAY = 19-Feb-2020
Output:
Day | Start Time | End Time | Start Hour | End Hour |
---|
19-Feb-2020 | 19 Feb 2020 00:00:00 | 19 Feb 2020 01:00:00 | 00:00:00 | 01:00:00 |
19-Feb-2020 | 19 Feb 2020 01:00:00 | 19 Feb 2020 02:00:00 | 01:00:00 | 02:00:00 |
19-Feb-2020 | 19 Feb 2020 02:00:00 | 19 Feb 2020 03:00:00 | 02:00:00 | 03:00:00 |
…. | ….. | ….. | ….. | ….. |
…. | ….. | ….. | ….. | … |
19-Feb-2020 | 19 Feb 2020 22:00:00 | 19 Feb 2020 23:00:00 | 22:00:00 | 23:00:00 |
19-Feb-2020 | 19 Feb 2020 23:00:00 | 19 Feb 2020 23:59:59 | 23:00:00 | 23:59:59 |
Could you please advice?
Look forward to hearing from you.
Regards,
Don