I have a table that has several columns I would like to get the previous value that is not null.
Create table #temp
(ID INT,
Testv Varchar(max)
)
Insert into #temp values (1,'')
Insert into #temp values (1,'abc')
Insert into #temp values (1,'def')
Insert into #temp values (1,'')
Insert into #temp values (1,'ijk')
Insert into #temp values (1,'')
Insert into #temp values (2,'xyz')
Insert into #temp values (2,'')
Insert into #temp values (2,'klm')
Insert into #temp values (2,'nop')
my desired output is as shown below




