Creating Dummy Records in Oracle SQL

I need to create empty record with value from previous record for a given date range.
For example, suppose I have table having following columns – Data and Balance with data as follows –

05/05/2015 - 500
09/05/2015 - 700

Now, I want to display the records for date 01/05/2015 to 10/05/2015 as follows

01/05/2015 - 0
02/05/2015 - 0
03/05/2015 - 0
04/05/2015 - 0
05/05/2015 - 500
06/05/2015 - 500
07/05/2015 - 500
08/05/2015 - 500
09/05/2015 - 700
10/05/2015 - 700

Is there any analytical function in oracle or any tricks to calculate that type of record set?
Please suggest.


Source: oracle

Leave a Reply