Page 1 of 1

How can I count DB filed value ?

Posted: Wed Aug 30, 2006 12:13 am
by Supper Baby
I've filed named Point

I want to count all the filed value ( the total value not the total filed number )

can I do it by using simple SQL query ? or should I do while statment to get it manually

Posted: Wed Aug 30, 2006 12:16 am
by shiznatix
Please reword your question so that it makes some sence.

You have a file named 'Point'? Do you want to count all the lines in this file? Is there a database involved? Please clarify what it is you are trying to do.

Posted: Wed Aug 30, 2006 12:23 am
by Supper Baby

Code: Select all

id    point
1     10
2     10
3     10
4     5
5     10
I want to get the total number ( 45 )

:oops: Sorry for my poor english language

Posted: Wed Aug 30, 2006 2:11 am
by Supper Baby
:D I found the answer

Code: Select all

SELECT sum(point)
FROM yourtable;
:) thanks to MySQL Forum http://forums.mysql.com/read.php?10,113 ... msg-113110