By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
16 rows affected
userID | year_month | no_cases_still_open | value_open | no_closed | value_closed |
---|---|---|---|---|---|
U1 | 2020-01-01 | 3 | 770 | 0 | 0 |
U1 | 2020-02-01 | 2 | 270 | 2 | 640 |
U1 | 2020-03-01 | 3 | 690 | 0 | 0 |
U1 | 2020-04-01 | 3 | 720 | 1 | 150 |
U1 | 2020-05-01 | 2 | 300 | 1 | 420 |
U2 | 2020-01-01 | 0 | 0 | 1 | 100 |
U2 | 2020-02-01 | 1 | 790 | 0 | 0 |
U2 | 2020-03-01 | 1 | 790 | 1 | 640 |
U2 | 2020-04-01 | 2 | 1110 | 0 | 0 |
U2 | 2020-05-01 | 1 | 790 | 1 | 320 |
U3 | 2020-01-01 | 1 | 350 | 0 | 0 |
U3 | 2020-02-01 | 1 | 350 | 0 | 0 |
U3 | 2020-03-01 | 2 | 1160 | 0 | 0 |
U3 | 2020-04-01 | 2 | 1160 | 0 | 0 |
U3 | 2020-05-01 | 3 | 1390 | 0 | 0 |
U4 | 2020-01-01 | 0 | 0 | 0 | 0 |
U4 | 2020-02-01 | 2 | 680 | 0 | 0 |
U4 | 2020-03-01 | 1 | 490 | 1 | 190 |
U4 | 2020-04-01 | 2 | 700 | 0 | 0 |
U4 | 2020-05-01 | 1 | 490 | 1 | 210 |
Warning: Null value is eliminated by an aggregate or other SET operation.