This is not exact ur requirement:Execute once...declare @t tABLE( id int, users varchar(10), age int)insert into @t SELECT 1, 'mohan', 40 union allSELECT 2, 'raju' ,null union allSELECT 3, 'kalli', 43 union allSELECT 4, 'asha', null union allSELECT 5, 'jisa', 43 union allSELECT 6, 'jaju', null union allSELECT 7, 'jazxdfju', 45 union allSELECT 8, 'jaju', null union allSELECT 9, 'kagvewlli', 43 union allSELECT 10, 'abxvsha', null union allSELECT 11, 'vgsfsa', 40;with cte AS (SELECT distinct id, age FROM @t WHERE age is NOT NULL)UPDATE @t SET age = c.ageFROM @t t1 cross apply (SELECT top 1 age FROM cte WHERE id >= t1.id ) cwhere t1.age is nullSELECT * FROM @t
--Chandu