As a side note, be sure that you do not use a float for any columns that deal
with money or you will get rounding errors.

--Bill
mysql


Yen-Chu Chen wrote:

> Hi,
>
>    Assume the name of the column is 'price' and the name of the table is
> 'table', you could use
>
>     SELECT SUM(price) FROM table;
>
> On Wed, 26 Sep 2001, Micke wrote:
>
> > Does anyone know how to write a query to get out the sum of a whole
> > table
> > column?
> >
> > ex. I'm playing around with a database where customers can buy stuff.
> > I have a table where I save all the invoices, but now I want to write
> > a query that sums upp all the prices in the price column in that
> > table.
> >
> > Is this possible? And if, how???
> >
> > ------------------------
> > Mikael Hultén


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