By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Cod1 | Cod2 | Payed | NotPayed |
---|---|---|---|
0001 | 000A | 0 | 1 |
0001 | 000B | 2 | 0 |
0001 | 000C | 0 | 1 |
0001 | 000D | 0 | 1 |
0002 | 000A | 1 | 0 |
0002 | 000C | 1 | 2 |
Warning: Null value is eliminated by an aggregate or other SET operation.