<snip>
 
> mysql> select first, second, SUM(first) from example group by first;
> +-------+--------+------------+
> | first | second | SUM(first) |
> +-------+--------+------------+
> | 1     | 2      |          1 |
> | 2     | 3      |          2 |
> +-------+--------+------------+
> 2 rows in set (0.00 sec)
> 
> 
> If it is not obvious, I want the sum of "first," which, by my 
> calculations, should be 3. What am I doing wrong?
> 

<snip>

If you would like the result of the query to be the sums of the columns
try this:

SELECT SUM(first), SUM(second) FROM example;

Or alternatively, just the sum from the first column use

SELECT SUM(first) FROM example;



---------------------------------------------------------------------
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

Reply via email to