By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
6 rows affected
| month | price | avg |
|---|---|---|
| 2017-10-01 00:00:00 | 4.5000000000000000 | 4.5000000000000000 |
| 2017-11-01 00:00:00 | 7.0000000000000000 | 5.7500000000000000 |
| 2017-12-01 00:00:00 | 4.5000000000000000 | 5.3333333333333333 |