declare @kw_test_sumup table (a int identity(1,1) primary key not null, b int)
insert into @kw_test_sumup(b)
select 2 union all
select 3 union all
select 4 union all
select 5 union all
select 5 union all
select 16 union all
select 16 union all
select 16
select * from @kw_test_sumup
select a.a,sum(b.b) [sum up above]
from @kw_test_sumup a,@kw_test_sumup b where a.a >= b.a group by a.a order by a.a
|