By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
10 rows affected
col_A | col_B |
---|---|
b123 | 10 |
b124 | 20 |
b123 | 30 |
b124 | 40 |
b123 | 50 |
a123 | 1 |
a124 | 2 |
a123 | 3 |
a124 | 4 |
a123 | 5 |
col_A | col_B |
---|---|
a123 | 9 |
a124 | 6 |
b123 | 90 |
b124 | 60 |
subtotal : a | 15 |
subtotal : b | 150 |
total | 165 |