From: George McQuade <josslad@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Table conversion query...
Date: Wed, 20 Aug 2003 12:31:43 -0700 (PDT)
Message-ID: <20030820193143.23054.qmail@web41611.mail.yahoo.com> (raw)
Hello everyone,
I have a table that looks like:
date tran gl amt
08/20/03 1001 3010 -30.00
08/20/03 1001 1030 -300.00
08/20/03 1001 1060 +330.00
08/20/03 1002 ...next transaction
...
and I need to convert to:
date glcr gldb amt
08/20/03 1060 3010 30.00
08/20/03 1060 1030 300.00
in other words, the negative gl's go into gldb
and they make up the total for the positive gl.
is there a way to accomplish this in postgresql?
or should I implement it inside the java app?
thanks
george
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
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: josslad@yahoo.com
Subject: Re: Table conversion query...
In-Reply-To: <20030820193143.23054.qmail@web41611.mail.yahoo.com>
* 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