By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
posNo | resID | Date_From | Date_To | seqNo |
---|---|---|---|---|
10001 | null | 2017-01-01 | 2017-12-31 | 0 |
10001 | 100 | 2018-01-01 | 2018-04-01 | 1 |
10001 | null | 2018-04-02 | 2018-05-31 | 0 |
10001 | 101 | 2018-06-01 | 2019-12-31 | 2 |
10001 | 100 | 2020-01-01 | 2020-12-31 | 3 |