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
>

-- 
   Best regards,    Yen-Chu Chen
                    [EMAIL PROTECTED]
                    Office: (630) 840-5403,  FAX: (630) 840-2968
                    (886)-(2)-2789-9681 (Inst. of Phys., Academia Sinica)


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