By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Customer | Amount | Date | Period | Group | Group_Period1 | Group_Period2 | Group_Period3 |
---|---|---|---|---|---|---|---|
12345 | 50 | 2022-02-28 | 1 | 1 | 1 | 2 | 3 |
12345 | 20 | 2022-03-31 | 2 | 2 | 1 | 2 | 3 |
12345 | 30 | 2022-04-30 | 3 | 3 | 1 | 2 | 3 |
77766 | 50 | 2022-02-28 | 1 | 2 | 2 | 2 | 3 |
77766 | 20 | 2022-03-31 | 2 | 2 | 2 | 2 | 3 |
77766 | 30 | 2022-04-30 | 3 | 3 | 2 | 2 | 3 |