Hi,
I have a table that has some gaps in data. I want to fill the gaps with consecutive dates and the dollar amount from the last row. Here is the sample data
create table gap_rows ( nkey number, effective_date timestamp, base_currency varchar2(5), currency varchar2(5), fx_rate number);
insert into gap_rows VALUES( 1, to_date('1/1/2023','mm/dd/yyyy'), 'USD','CAD',2500);
insert into gap_rows VALUES( 2, to_date('1/1/2023','mm/dd/yyyy'), 'USD','GBP',2500);
insert into gap_rows VALUES( 3, to_date('1/1/2023','mm/dd/yyyy'), 'EUR','USD',2500);
insert into gap_rows VALUES( 4, to_date('1/5/2023','mm/dd/yyyy'), 'USD','GBP',2500);
insert into gap_rows VALUES( 5, to_date('1/9/2023','mm/dd/yyyy'), 'USD','CAD',2500);
insert into gap_rows VALUES( 6, to_date('1/10/2023','mm/dd/yyyy'), 'EUR','USD',2500);
insert into gap_rows VALUES( 7, to_date('1/10/2023','mm/dd/yyyy'), 'USD','GBP',2500);
insert into gap_rows VALUES( 8, to_date('1/18/2023','mm/dd/yyyy'), 'USD','CAD',2500);
So for the base_currencty “USD” and Currency “CAD” the first effective_date is 1/1/2023 and fx_rate is 2500.
The next record for base_currencty “USD” and Currency “CAD” the first effective_date is 1/9/2023 and fx_rate is 2600.
The last record for base_currencty “USD” and Currency “CAD” the first effective_date is 1/18/2023 and fx_rate is 2750.
So the query should fill the gap between 1/1/2023 and 1/9/2023 with consecutive dates and the fx_rate as 2500 with the same “nkey” number.
And then it should fill the row between 1/9/2023 and 1/18/2023 with consecutive dates and the fx_rate as 2600 with the same “nkey” number.
The consecutive dates should be listed in a new column called “FILL_DATE”.
I have attached an image with the base valus and the output values. 
The same logic will be applicable to all the nkey, base_currency, and currency combinations.
Thanks