select A, sum(B) group by A