I have a table with two columns. Items in the first column represent one of four categories, and items in the second column represent the data referenced by their category counterpart:
CategoryA : 2
CategoryC : 1
CategoryB : 4
CategoryB : -1
CategoryD : 2
CategoryC : 1
etc.
I need to construct a SQL query that will return the Sum for each of these categories, e.g.
CategoryA : 2
CategoryB : 3
CategoryC : 2
CategoryD : 2
You can do it by grouping together the relevant rows, and summing the values for each: