faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

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

8 of 13 people (62%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I add up numbers in a colum? IE SUM all the values in the colum.

May 3rd, 2004 18:04
Michael Harrison, Narendra Jain,


If you have a order table and you want a total of quantity column, use 
the query as below:
select sum(quantity)
from order_table
That did the trick. I looked all over for the sum() command and cound 
not find info for it. Thanks.