id| name total
1 | meow 1
2 | meow 2
3 | raf 5
4 | meow 5
5 | raf 5
我希望得到一个结果
喵喵= 8 raf = 10答案 0 :(得分:3)
SELECT name,
SUM(total) total_sum
FROM tablename
GROUP BY name
答案 1 :(得分:2)
您可以使用一组名称来获得个别金额
select name, sum(total) as totals
from your_table
group by name