Hi @Santosh Kumar
Please check this :
;WITH CTE AS
(SELECT T.*,C.Region AS New_Region
FROM Your_table T CROSS APPLY(SELECT TOP(1)Region FROM Your_table
WHERE Region IS NOT NULL AND custumerID=T.custumerID
ORDER BY Date)C
)--SELECT * FROM CTE WHERE Region IS NULL
UPDATE CTE
SET Region=New_Region
WHERE Region IS NULL
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.