By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
6 rows affected
| date | col1 | col2 | col3 | opening | closing |
|---|---|---|---|---|---|
| 2017-01-01 | 10 | 10 | 20 | 0 | 40 |
| 2017-01-02 | 10 | 10 | 20 | 40 | 80 |
| 2017-01-03 | 10 | 10 | 20 | 80 | 120 |
| 2017-01-04 | 10 | 10 | 20 | 120 | 160 |
| 2017-01-05 | 10 | 10 | 20 | 160 | 200 |
| 2017-01-06 | 10 | 10 | 20 | 200 | 240 |