Table conversion query...

From: George McQuade <josslad(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Table conversion query...
Date: 2003-08-20 19:31:43
Message-ID: 20030820193143.23054.qmail@web41611.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Aasmund Midttun Godal 2003-08-20 19:34:15 Re: Before/After Trigger User Switching
Previous Message Joe Conway 2003-08-20 19:24:33 Re: "SELECT IN" Still Broken in 7.4b