I have a table that looks like this:
ds | num_teams
--------------------------
2020-01-08 | 13
2020-01-05 | 9
2020-01-02 | 11
2019-12-31 | 8
But I need to fill in the missing date strings in a way that's consistent with increases / decreases, resulting in something like this:
ds | num_teams
--------------------------
2020-01-08 | 13
2020-01-07 | 9
2020-01-06 | 9
2020-01-05 | 9
2020-01-04 | 11
2020-01-03 | 11
2020-01-02 | 11
2020-01-01 | 8
2019-12-31 | 8
This is also a read-only database so it has to be done in a SQL SELECT
statement, so I'm thinking it might be possible using OVER()
somehow?