By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| date | diff_max |
|---|---|
| 2017-01-04 | -3 |
| 2017-01-09 | -7 |
| 2017-01-11 | -10 |
| 2017-01-13 | -2 |
| diff_date_from | diff_date_to | diff_max_date | diff_max |
|---|---|---|---|
| 2017-01-04 | 2017-01-06 | 2017-01-04 | -3 |
| 2017-01-09 | 2017-01-11 | 2017-01-11 | -10 |
| 2017-01-13 | 2017-01-13 | 2017-01-13 | -2 |