By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
date1 | date2 | date3 | max_date |
---|---|---|---|
2019-01-01 | 2019-01-20 | 2019-02-10 | 2019-02-10 |
null | null | 2019-02-01 | 2019-02-01 |
null | 2019-02-01 | 2019-02-02 | 2019-02-02 |
Warning: Null value is eliminated by an aggregate or other SET operation.