I have the following table:
DECLARE @TempTable TABLE
(
ID int,
Lastname nvarchar(50),
Firstname nvarchar(50),
Age int
)
insert into @TempTable (ID, Lastname, Firstname, Age)
VALUES(1, 'Smith', NULL, NULL),
(2, NULL, 'Will', 40),
(3, NULL, 'Jaden', 20),
(4, 'Matt', NULL, NULL),
(5, NULL, 'Damon', 39)
I want to change the table using 'update' as follows:
I know about the functions 'lag' and 'lead'. But as I understand they can not be used in UPDATE expressions

