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!

Sequence number in oracle SQL SQL

Vemula MuniJul 29 2019 — edited Jul 31 2019

Hi I have my data as below.

Year    Period  Start_Date  End_Date 2019    6        1-Jun-19    30-Jun-19 2019    7        1-Jul-19    31-Jul-19

Period will be the month number

start date and end date will be the month start and end dates.

I want to fetch the data as below based on above.

Period  Sequence_no Period_end_dt 6        1           07-Jun-19 6        2           14-Jun-19 6        3           21-Jun-19 6        4           28-Jun-19 6        5           05-Jul-19 ( when ever month last day is not equal to Friday i need to display next month first Friday in current month).7        1           05-Jul-19 7        2           12-Jul-19 7        3           19-Jul-19 7        4           26-Jul-197        5           26-Aug-19( when ever month last day is not equal to Friday i need to display next month first Friday in current month).

in above out put data Period_end_dt values will be the Fridays in between start and end date in my source data. .

This post has been answered by mathguy on Jul 30 2019
Jump to Answer

Comments

Post Details

Added on Jul 29 2019
14 comments
907 views