Is there a straightforward query to fill in the gaps in a column with the next non-null value in that column? I want a column which has data like this:
--------------------
| ID | Version |
--------------------
| 1 | '162.39' |
--------------------
| 2 | NULL |
--------------------
| 3 | NULL |
--------------------
| 4 | '162.40' |
--------------------
| 5 | '162.41' |
--------------------
| 6 | NULL |
--------------------
| 7 | NULL |
--------------------
| 8 | '162.42' |
--------------------
| 9 | '162.42' |
--------------------
| 10 | NULL |
--------------------
To end up like this
--------------------
| ID | Version |
--------------------
| 1 | '162.39' |
--------------------
| 2 | '162.40' |
--------------------
| 3 | '162.40' |
--------------------
| 4 | '162.40' |
--------------------
| 5 | '162.41' |
--------------------
| 6 | '162.42' |
--------------------
| 7 | '162.42' |
--------------------
| 8 | '162.42' |
--------------------
| 9 | '162.42' |
--------------------
| 10 | NULL |
--------------------
The last value(s) can either be '162.42' or remain at NULL.
Try this:
I didnt try it, maybe you will have to fix some details.