-- Collection of code snippets by Arne Vajhøj 
-- (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
SELECT a.f1,SUM(b.f1) FROM t1 a JOIN t1 b ON b.f1<=a.f1 GROUP BY a.f1;
