Hi All,
Oracle version - 19c.
I want to generate the week wise record from a startdate of my record till it reaches to enddate.
My startdate should add next week date and add the record in my result set as below:
My start of the week is Monday 18-Jul-22 so next date will be 25-Jul-22 and then 01-Aug-22 and so on
with t as (
select '111' id, 'AU-1221' as loc, to_date('18-JUL-22') as startdate, to_date('16-JAN-24') as enddate, 0 qty from dual union all
select '222' id, 'Bo-5522' as loc, to_date('18-JUL-22') as startdate, to_date('14-AUG-23') as enddate, 0 qty from dual
)
select * from t;
OUTPUT:
ID LOC STARTDATE ENDDATE QTY
111 AU-1221 18-JUL-22 16-JAN-24 0
111 AU-1221 25-JUL-22 16-JAN-24 0
111 AU-1221 01-AUG-22 16-JAN-24 0
111 AU-1221 08-AUG-22 16-JAN-24 0
111 AU-1221 15-AUG-22 16-JAN-24 0
111 AU-1221 22-AUG-22 16-JAN-24 0
...
222 Bo-5522 18-JUL-22 14-AUG-23 0
222 Bo-5522 25-JUL-22 14-AUG-23 0
222 Bo-5522 01-AUG-22 14-AUG-23 0
222 Bo-5522 08-AUG-22 14-AUG-23 0
222 Bo-5522 15-AUG-22 14-AUG-23 0
...
Regards,
Sid