Spambusting: MySQL
> 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