faqts : Computers : Databases : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

7 of 32 people (22%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How to calculate the running total of a table

Feb 20th, 2008 23:09
dman, Matt Chatterley, Tony Bland, http://sturly.com


Assuming you have a column (e.g. 'Value') in a table and you want to
know the total of all the rows added together (Value+Value...), you
could do:
SELECT SUM(Value) AS Total FROM Table1;