By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
AA | BB | CC | DD | EE |
---|---|---|---|---|
201902 | X | 1000 | 1 | 1 |
201902 | X | 1000 | 2 | 2 |
201902 | X | 1001 | 4 | 3 |
201902 | Y | 2000 | 6 | 4 |
201902 | Y | 2001 | 8 | 5 |
201903 | Y | 2002 | 10 | 6 |
201904 | Y | 2002 | 12 | 7 |
AA | BB | DD |
---|---|---|
201902 | X | 6 |
201902 | Y | 14 |
201903 | Y | 10 |
201904 | Y | 12 |