I have two columns like this:
Word | Amount |
---|---|
dog | 1 |
dog | 5 |
Elephant | 2 |
I want to sum the amounts and get the result
Word | Amount |
---|---|
dog | 6 |
Elephant | 2 |
What I have tried (and failed) so far is:
SELECT word, SUM(amount) FROM `Data` GROUP BY 'word'
It should beaccentedsymbol instead ofsingle quote:
Output:
Remove the single quotes around
WORD
. It causes column names to be converted to strings.