By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| id | cum_sum | date |
|---|---|---|
| 1 | 100 | 2018-04 |
| 1 | 100 | 2018-05 |
| 1 | 150 | 2018-06 |
| 1 | 150 | 2018-07 |
| 1 | 150 | 2018-08 |
| 2 | 110 | 2018-04 |
| 2 | 110 | 2018-05 |
| 2 | 110 | 2018-06 |
| 2 | 160 | 2018-07 |
| 2 | 170 | 2018-08 |