Re: aggregate function ?

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Raimon Fernandez <coder(at)montx(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: aggregate function ?
Date: 2007-05-16 13:01:46
Message-ID: 833051.59952.qm@web31806.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


--- Raimon Fernandez <coder(at)montx(dot)com> wrote:

> but If I send the code that you send me, it takes too much .... well,
> more than 20 minutes and still waiting ...

just for testing try this version again so see if it preforms much better, then see if the summing
results are correct according to what you need.

SELECT A1.oid, A1.concepte, A1.deure, A1.haver,
sum( COALESCE( A1.deure, 0 ) - COALESCE( A2.haver, 0 )) AS value_sum
FROM Assentaments AS A1
INNER JOIN Assentaments AS A2
ON A1.oid <= A2.oid
WHERE A1.numero=11189
GROUP BY A1.oid, A1.concepte, A1.deure, A1.haver
ORDER BY A1.oid;

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Raimon Fernandez 2007-05-16 13:34:57 Re: aggregate function ?
Previous Message Raimon Fernandez 2007-05-16 12:43:59 Re: aggregate function ?