SUM agregate

David Horwitz <dhorwitz@its.uct.ac.za>

From: "David Horwitz" <dhorwitz@its.uct.ac.za>
To: pgsql-novice@hub.org
Date: 2000-10-23T09:18:00Z
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@its.uct.ac.za         SOUTH AFRICA
Tel:+27 21 650 3841          Fax:+27 21 650 5045
http://www.meg.uct.ac.za
*************************************************