Returns the sum of the values ​​common to an attribute in sql?

I have a few lines that look like this:

name value ------------ Name 1 Name 2.8 Name 8 

I want my return to be a single line:

 name value ------------ Name 11.8 

How can I make this deal? 11.8. Being the sum of the values.

+4
source share
1 answer

You can try this

 SELECT Name, SUM(Value) FROM MyTable GROUP BY Name 
+7
source

All Articles