I have a table which looks like this:
ID | money_earned | days_since_start |
---|---|---|
1 | 1000 | 1 |
1 | 2000 | 2 |
1 | 3000 | 4 |
1 | 2000 | 5 |
2 | 1000 | 1 |
2 | 100 | 3 |
I want that rows, without a days_since_start (which means that the money_earned column was empty that day) - will include all the days PER ID, and fill the money_earned with last known value, so it to look like this:
ID | money_earned | days_since_start |
---|---|---|
1 | 1000 | 1 |
1 | 2000 | 2 |
1 | 2000 | 3 |
1 | 3000 | 4 |
1 | 2000 | 5 |
2 | 1000 | 1 |
2 | 1000 | 2 |
2 | 100 | 3 |
I have tried to look up for something like that, but I don't even know what function does that...
thank you!