我有 2 列是这样的:
+----------+--------+
| word | amount |
+----------+--------+
| dog | 1 |
| dog | 5 |
| elephant | 2 |
+----------+--------+
我想总结金额,得到结果
+----------+--------+
| dog | 6 |
| elephant | 2 |
+----------+--------+
到目前为止,我尝试过(但失败了)是这样的:
SELECT word, SUM(amount) FROM `Data` Group By 'word'