if OBJECT_ID('TEMPDB..#FR_TEST') IS NOT NULL DROP TABLE #FR_TEST
CREATE TABLE #FR_TEST(
[ID][NVARCHAR](100) NULL,
[SL] [decimal](18, 0) NULL
)
insert into #FR_TEST
select '1','1'
union all
select '2','2'
union all
select '3','3'
union all
select '4','4'
union all
select '5','5'
union all
select '6','6'
union all
select '7','7'
union all
select '8','8'
go
select ID,sl,
avg(sl) over(order by ID) as nsj
from #FR_TEST order by ID