I have a table like this:
Date | Category | Item | Value |
---|---|---|---|
01-01-23 | Bike | A | 10 |
25-01-23 | Bike | A | 20 |
01-01-23 | Helmet | B | 100 |
01-03-23 | Helmet | B | 200 |
I need to populate the date for the rows so the item A will have rows with 01-01-2023 until 24-01-2023 with 10 as value and for 25-01-2023 until TODAY will have value of 20. Same is applied with item B.
Thanks!
====
Edited
Thanks to @Ponder Stibbons for the answer, it's working. However when I applied it with some tweaks for my table, my Dedicated SQL Pool in Azure can't detect the Generate_series function. After some research, I assume that Dedicated SQL Pool doesn't support it yet. May someone helps with the same exact requirements but using SQL Server 2016 queries?
Thank you and please open the question.