hopefully the title was confusing enough to someone that they may look in to see what in the world I'm talking about.
I have a table that contains product_ids, review_dates, and aggregated ratings. Here's what I need: I need to create a file that has every day(starting with the first date a product was reviewed) and the aggregated rating for that day. The issue is coming when product x is reviewed on 9/1,9/2,9/8,10/4. I have physical rows for each of those 4 in my current table. Now i have to fill 9/3-9/7 with the values for 9/2(since the rating hasn't changed) and like wise 9/9-10/3 with the rating value for 9/8. ie: This is what I have
table
x 9/1 5.0
x 9/2 4.75
x 9/5 4.25
x 9/7 4.8
What I need is
table
x 9/1 5.0
x 9/2 4.75
x 9/3 4.75
x 9/4 4.75
x 9/5 4.25
x 9/5 4.25
x 9/7 4.8
Each item in the table will have different start dates. I just need to fill in any missing dates to current from the starting date forward.
I have a table that contains product_ids, review_dates, and aggregated ratings. Here's what I need: I need to create a file that has every day(starting with the first date a product was reviewed) and the aggregated rating for that day. The issue is coming when product x is reviewed on 9/1,9/2,9/8,10/4. I have physical rows for each of those 4 in my current table. Now i have to fill 9/3-9/7 with the values for 9/2(since the rating hasn't changed) and like wise 9/9-10/3 with the rating value for 9/8. ie: This is what I have
table
x 9/1 5.0
x 9/2 4.75
x 9/5 4.25
x 9/7 4.8
What I need is
table
x 9/1 5.0
x 9/2 4.75
x 9/3 4.75
x 9/4 4.75
x 9/5 4.25
x 9/5 4.25
x 9/7 4.8
Each item in the table will have different start dates. I just need to fill in any missing dates to current from the starting date forward.