By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
9 rows affected
| Id | CustomerNumber | Payment_installments | Date | previous_installement |
|---|---|---|---|---|
| 1 | 2 | 0 | 2022-01-02 | 0 |
| 2 | 2 | 0 | 2022-02-10 | 0 |
| 3 | 2 | 1 | 2022-04-05 | 0 |
| 5 | 2 | 0 | 2022-06-08 | 1 |
| 6 | 2 | 0 | 2022-08-22 | 0 |
| 7 | 2 | 1 | 2022-10-03 | 0 |
| 9 | 2 | 0 | 2023-01-04 | 1 |
| 4 | 3 | 0 | 2022-06-01 | 0 |
| 8 | 3 | 0 | 2022-11-04 | 0 |
| Id | CustomerNumber | Payment_installments | Date | previous_installement | sm |
|---|---|---|---|---|---|
| 1 | 2 | 0 | 2022-01-02 | 0 | 0 |
| 2 | 2 | 0 | 2022-02-10 | 0 | 0 |
| 3 | 2 | 1 | 2022-04-05 | 0 | 0 |
| 5 | 2 | 0 | 2022-06-08 | 1 | 1 |
| 6 | 2 | 0 | 2022-08-22 | 0 | 1 |
| 7 | 2 | 1 | 2022-10-03 | 0 | 1 |
| 9 | 2 | 0 | 2023-01-04 | 1 | 2 |
| 4 | 3 | 0 | 2022-06-01 | 0 | 0 |
| 8 | 3 | 0 | 2022-11-04 | 0 | 0 |
| Id | CustomerNumber | Payment_installments | Date | HasInstallmentPaymentInThePast |
|---|---|---|---|---|
| 1 | 2 | 0 | 2022-01-02 | 0 |
| 2 | 2 | 0 | 2022-02-10 | 0 |
| 3 | 2 | 1 | 2022-04-05 | 0 |
| 4 | 3 | 0 | 2022-06-01 | 0 |
| 5 | 2 | 0 | 2022-06-08 | 1 |
| 6 | 2 | 0 | 2022-08-22 | 1 |
| 7 | 2 | 1 | 2022-10-03 | 1 |
| 8 | 3 | 0 | 2022-11-04 | 0 |
| 9 | 2 | 0 | 2023-01-04 | 1 |