I have a table that is setup like
id | upc | count
----------------
1 | 100 | 5
2 | 100 | 12
3 | 101 | 3
4 | 100 | 7
and I would like to get the sum of the individual upc’s
Expected output:
upc | count
--- | -----
100 | 24
101 | 3
and I’m not really sure how to go about it. Any help would be appreciated.
Use GROUP BY and the SUM aggregate function: