I have the following configuration: a table called source (bid, valid_from, valid_to, qty) and destination (bid, jan, feb, mar, apr, …., dec).
I would like to insert the data from source into origin, (spliting the qty equally to the valid_from-valid_to months and the remaining rest to the last month in the timeframe) like this : if the record in source is
00001 01.02.2001 31.06.2001 132
this would be translated into destination :
00001 0 26 26 26 26 28 0 0 0 0 0 0
How could I do this?
Thank you!
I’m assuming
valid_from/valid_tonever spans multiple years; i.e.,TO_DATE(valid_from,'YYYY')always= TO_DATE(valid_to,'YYYY').