mysql count the sum of all rows mysql count the sum of all rows database database

mysql count the sum of all rows


Do you mean like this?

SELECT    SUM(value)FROM      myTable

If you have multiple columns to return, simply add each non-aggregate (i.e., summed) row to the GROUP BY clause:

SELECT    firstName, lastName, SUM(value)FROM      myTableGROUP BY  firstName, lastName


SELECT SUM(value) as total FROM table;$row['total'];