SUM agregate

From: "David Horwitz" <dhorwitz(at)its(dot)uct(dot)ac(dot)za>
To: pgsql-novice(at)hub(dot)org
Subject: SUM agregate
Date: 2000-10-23 09:18:00
Message-ID: E13ndkc-0005ER-00@mail3.uct.ac.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi All,

I'm having problems with the sum() agregate function. Simply put I
want to query a table and return grouped sum agregates. The SQL im
using is:

SELECT PortfolioCurrValue.MID, Sum(PortfolioCurrValue.CurrValue) AS
PortfolioValue
FROM PortfolioCurrValue
GROUP BY PortfolioCurrValue.MID;

currValue conatins large integers ( the largest is curently
195680000) the largest sum should be un the region of 199905000. The
query returns a number of responces per 'mid' (not just the sum of
the values per mid). Infact it apears to return a row per value

Converting the data-type to int8 seems to have no afect on the error.

Anyadvise?

Thanks

David Horwitz

****************************************************
David Horwitz University of Cape Town
IT Officer Private Bag
Multimedia Education Group Rondebosch
7701
dhorwitz(at)its(dot)uct(dot)ac(dot)za SOUTH AFRICA
Tel:+27 21 650 3841 Fax:+27 21 650 5045
http://www.meg.uct.ac.za
*************************************************

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Scott Muir 2000-10-23 18:44:05 Using external Apps from inside pgsql.
Previous Message Vic 2000-10-23 01:16:02 Re: It's a bug???? 8-()