Wednesday 15 September 2010

How to get sum of values in MySql -



How to get sum of values in MySql -

i have got table:

id name amount -------------------------- 1 abc 1 2 abc 2 3 abc -3 4 def 4

i want sum of every amounts of name==abc, mean 1+2+(-3) = 0;

how in mysql?

select sum(amount) table name = 'abc';

mysql

No comments:

Post a Comment