Here’s the dilemma: I have a table with rows. I need to count based on frequency of a certain value (in the eMail column), and then ADD numbers in certain column (cost)… as an example
mail cost
me@me.com 10
me@me.com 5
john@john.com 3
me@me.com 7
john@john.com 2
So I need to group rows based on the email address, and add the numbers in the grouped rows “cost” column. The results should come out as an array:
email frequency totalCost
me@me.com 3 22
john@john.com 2 5
This can be done with a single SQL query.