By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
12 rows affected
| SALES_DATE | SALES_VALUE | LAST_MONTH_SALES | LAST_YEAR_SALES |
|---|---|---|---|
| 2019-04-01 00:00:00 | 20 | 0 | 0 |
| 2019-05-01 00:00:00 | 50 | 20 | 0 |
| 2019-06-01 00:00:00 | 60 | 50 | 0 |
| 2019-07-01 00:00:00 | 10 | 60 | 0 |
| 2019-08-01 00:00:00 | 20 | 10 | 0 |
| 2019-09-01 00:00:00 | 10 | 20 | 0 |
| 2020-04-01 00:00:00 | 70 | 0 | 20 |
| 2020-05-01 00:00:00 | 100 | 70 | 50 |
| 2020-06-01 00:00:00 | 10 | 100 | 60 |
| 2020-07-01 00:00:00 | 10 | 10 | 10 |
| 2020-08-01 00:00:00 | 20 | 10 | 20 |
| 2020-09-01 00:00:00 | 20 | 20 | 10 |