For example, lets say I have
id | values |
---|---|
1 | 10 |
1 | 12 |
1 | 10 |
2 | 2 |
2 | 5 |
2 | 4 |
then i would want sql to return
id | values |
---|---|
1 | 32 |
2 | 11 |
CodePudding user response:
This is very basic sql.
select id, sum(values) as values
from foo
group by id
CodePudding user response:
Select ID,sum(values) From table Group by ID;