I may be overthinking this, but here goes:
I have 2 tables, one which is a date table; say "Dates", which holds all the dates in a calendar year. It looks like this:
Date
01-Jan-22
02-Jan-22
03-Jan-22
04-Jan-22
04-Jan-22
05-Jan-22
I have another table which is a "Deals" table and looks like this:
DealNo. StartDate EndDate Amount
1ahk 02-Jan-22 04-Jan-22 10,000
1hyt 03-Jan-22 05-Jan-22 5,000
5tiu 01-Jan-22 03-Jan-22 8,000
I would like to join these 2 and produce a table that looks like the following:
Date DealNo. Amount
02-Jan-22 1ahk 10,000
03-Jan-22 1ahk 10,000
04-Jan-22 1ahk 10,000
03-Jan-22 1hyt 5,000
04-Jan-22 1hyt 5,000
05-Jan-22 1hyt 5,000
01-Jan-22 5tiu 8,000
02-Jan-22 5tiu 8,000
03-Jan-22 5tiu 8,000
Any assistance on how I can achieve this with Oracle SQL, will be greatly appreciated.
Hope I have explained well.
HeC