"Simplicity can't be bought later, it must be earned from the start" -- DB
with data as ( select * from (values (25),(3),(4),(7),(15),(24),(20),(27), (11) ) as x(y) ) select y, sum(y) over(order by y) from data
y | sum ----+----- 3 | 3 4 | 7 7 | 14 11 | 25 15 | 40 20 | 60 24 | 84 25 | 109 27 | 136 (9 rows)
No comments:
Post a Comment