Filling the missing gaps(Sql Server 2005) [Set based using recursive CTE]
- by Thinking
I have a table
MissingData
1
10
NULL
NULL
22
NULL
The desired output will be
MissingData
1
10
10
10
22
22
i.e. the nulls will be filled up by the previous value until a new value is appearing.
I can solve this by using loop but my requirement is to solve it by CTE in which I am not so comfortable as of now.
Thanks