-- Collection of code snippets by Arne Vajhøj 
-- posted to eksperten.dk, usenet and other places (2002-now) 
SELECT a.f1,SUM(b.f1) FROM t1 a JOIN t1 b ON b.f1<=a.f1 GROUP BY a.f1;
