Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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
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.



David Horwitz

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

In response to

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group