I have a table with some data similar to this:
col1 | col2
-----------
val1 1
val1 5
val1 7
val2 3
val2 1
val2 4
val3 8
What I would like is a query to produce something like this:
col1 | sum
----------
val1 13
val2 8
val3 8
I’ve tried doing this with complicated subqueries, but nothing is quite panning out. I think I may be overthinking it.
This should be all you need. This uses the aggregate
SUMwith aGROUP BY.