I need to copy data from rows with non-null rows and if first row is null copy the next non-null value.
it is not a big table. There is no ID column and date column.
The datatype of this column is varchar.
I am using SQL Server 2012
This is how the data is in the table:
Masked |
---|
5574-12XX-XXXX-1338 |
6674-13XX-XXXX-0855 |
7784-14XX-XXXX-5237 |
Null |
Null |
Null |
9984-11XX-XXXX-6196 |
3384-11XX-XXXX-0615 |
Null |
Null |
This is expected result.
Masked |
---|
5574-12XX-XXXX-1338 |
6674-13XX-XXXX-0855 |
7784-14XX-XXXX-5237 |
7784-14XX-XXXX-5237 |
7784-14XX-XXXX-5237 |
7784-14XX-XXXX-5237 |
9984-11XX-XXXX-6196 |
3384-11XX-XXXX-0615 |
3384-11XX-XXXX-0615 |
3384-11XX-XXXX-0615 |
online solutions work with simple data. but I am struggling with this data. I am very desperate for the solution. Thanks in advance.