Thennarasu
Thennarasu

Reputation: 474

How to Calculate amount value of employees repeated many times

I have SQL file that contains more than 500 employees. So many employee are repeated many times like

 Name    amount   Id 
 --------------------     
 Raj     500      1
 Kumar   300      4
 Karthi  400      3
 Raj     300      1
 Raj     800      1
 Kumar   300      4

In the above sample, Raj is repeated many times. My question: I want to calculate all Raj name Amount values. How can I get the total amount of Raj employee? Please give some idea please help me

Upvotes: 0

Views: 45

Answers (1)

Jens
Jens

Reputation: 69470

simply use sum and group by

select sum(amount), Name from table Group by name

Upvotes: 2

Related Questions