Page 1 of 1

Adding values from a column in MySQL

Posted: Fri Jun 20, 2003 11:06 pm
by HansKippenhagen
Does anyone know how to add all of the values in a column. I suppose you could use mysql_fetch_array but i was wondering if there were a easier way. thanks

Posted: Fri Jun 20, 2003 11:58 pm
by trollll
Try using:

Code: Select all

SELECT SUM(column_name) FROM table_name;