By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
3 rows affected
| name | debt | start_date | end_date |
|---|---|---|---|
| A | 100 | 2022-01-01 | 2022-03-31 |
| A | 100 | 2022-02-01 | 2022-03-31 |
| A | 100 | 2022-03-01 | 2022-03-31 |
| B | 50 | 2022-01-01 | 2022-02-28 |
| B | 50 | 2022-02-01 | 2022-02-28 |
| C | 80 | 2023-02-01 | 2023-02-28 |