Reputation: 2286
How could one achieve to get sums of column values regarding tags in a second column?
tag1 1000
tag1 2000
tag2 1000
tag3 1000
tag2 3000
tag1 1000
tag3 1000
tag3 1000
tag2 2000
tag3 2000
The required result looks like this
tag1 4000
tag2 6000
tag3 5000
Upvotes: 1
Views: 306
Reputation: 13425
GROUP BY
on the tag column with sum
SELECT tagColumn, sum(tagValue) as TotalCount
FROM Table1
GROUP BY tagColumn
Upvotes: 1