0

I have a table in my database that looks like this.

id    count
-----------
1      23
2      20
3      12
4      4

The "count" column will periodically change. How would I add all the values in the count column and display them on the front end? So for example, in this case they would add up to 59.

1
  • 1
    Did you do any research at all? The MySQL documentation lists all the functions and operators at your disposal; it is obvious in this case which to pick if you peruse it. Commented Oct 28, 2011 at 19:32

2 Answers 2

3
select sum(count) from table_name
Sign up to request clarification or add additional context in comments.

Comments

0
SELECT SUM(`count`) FROM myTable

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.