question about query

From: Linos <info(at)linos(dot)es>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: question about query
Date: 2011-06-30 13:00:02
Message-ID: 4E0C7352.7030401@linos.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
i am trying to obtain from the database what we have been doing in a excel
sheet from some time.

I have some tables where i store the documents associated with our customers,
invoices, payments and others, what i need to get from this tables it is a
movement log where i can get what payment it is pending from this customer after
the change in this row, for example:

movement | qty | pending
invoice N-111 | 1000.0 | 1000.0
payment 1 N-111 | 200.0 | 800.0
payment 1 N-111 | 150.0 | 550.0
invoice N-112 | 350.0 | 900.0

how could i calculate this pending column that does not exists in the database
and i need to be based on last result row? I would like to get with raw SQL but
the need to use any procedural language would not be a problem.

Thanks!

Regards,
Miguel Angel.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2011-06-30 13:04:32 Re: Windows x64 : How do I get OSSP-UUID.sql contrib for postgresql x64
Previous Message Guillaume Lelarge 2011-06-30 08:16:27 Re: How did I get 8 Exclusive locks on the same table? And how many locks is too many?