pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@surnet.cl>
To: lucas@presserv.org
Cc: pgsql-sql@postgresql.org
Subject: Re: Sum() rows
Date: Tue, 31 May 2005 16:17:11 -0400
Message-ID: <20050531201711.GH9257@surnet.cl> (raw)
In-Reply-To: <20050531133648.cypdc5lnjtc0wsws@www.presserv.org>
References: <20050531133648.cypdc5lnjtc0wsws@www.presserv.org>

On Tue, May 31, 2005 at 01:36:48PM -0300, lucas@presserv.org wrote:
> Hi.
> How can I sum a row and show the sum for each row???
> For example, in a finances table that have the total movimentation(debit/credit)
> in the bank.

I think you can write an aggregate in, say PL/Python to do this.  IIRC
there was an article on General Bits about this.  Search for "running
aggregates".  I think there is something in issue #23.  See #29 as well.

-- 
Alvaro Herrera (<alvherre[a]surnet.cl>)
"Las cosas son buenas o malas segun las hace nuestra opinión" (Lisias)



view thread (10+ messages)  latest in thread

Message-ID: <20050531201711.GH9257@surnet.cl>
Permalink:  ../20050531201711.GH9257@surnet.cl/
Also on:    postgresql.org/message-id/20050531201711.GH9257@surnet.cl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: alvherre@surnet.cl, lucas@presserv.org
  Subject: Re: Sum() rows
  In-Reply-To: <20050531201711.GH9257@surnet.cl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox