Thanks for hte help with both the SUM and ABG mysql fuction, can you take a look at my last e-mail too and see if you can help me implement this code into my site?
Thanks! -------------------------------------------- -Alex "Big Al" Behrens E-mail: [EMAIL PROTECTED] Urgent E-mail: [EMAIL PROTECTED] (Please be brief!) Phone: 651-482-8779 Cell: 651-329-4187 Fax: 651-482-1391 ICQ: 3969599 Owner of the 3D-Unlimited Network: http://www.3d-unlimited.com Send News: [EMAIL PROTECTED] ----- Original Message ----- From: "DL Neil" <[EMAIL PROTECTED]> To: "Alex Behrens" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, March 02, 2002 5:22 PM Subject: Re: adding up row values.... > Hey Alex, > > > I am looking to take a column in my table and add all the values, they > are > > all numerical. how do I do this? Below is an example of my table: > > > > > +-----------------+--------+------+---------+-------------+-------+----- > ---- > > -----+---------------+------------+ > > | name | number | team | penalty | groundballs | shots | > > faceoffs_won | faceoffs_lost | date | > > > +-----------------+--------+------+---------+-------------+-------+----- > ---- > > -----+---------------+------------+ > > | pete nelson | 29 | V | none | 7 | 17 | > > 4 | 3 | 2002-03-01 | > > | darrenolson | 91 | V | none | 13 | 32 | > > 2 | 1 | 2002-03-02 | > > | vanguildertest4 | 17 | V | none | 5 | 15 | > > 1 | 1 | 2002-03-01 | > > > +-----------------+--------+------+---------+-------------+-------+----- > ---- > > -----+---------------+------------+ > > > > I want to add all of the values for the groundballs, shots, and > faceoffs, > > how do I make it add up row values? > > > There are a whole range of useful functions to be found at 6.3 Functions > for Use in SELECT and WHERE Clauses. What you are asking about is SUM() > which is documented at 6.3.7 Functions for Use with GROUP BY Clauses. Go > back up a few lines and you'll find another handy statistical function > AVG(), which includes an example of usage. > > Now tell me again, how do I swing the bat to hit a home run? > =dn > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php