X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B1F82D1B4ED for ; Wed, 15 Oct 2003 19:49:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 20800-06 for ; Wed, 15 Oct 2003 16:48:53 -0300 (ADT) Received: from smtp-1.indo.net.id (smtp-1.indo.net.id [202.159.32.91]) by svr1.postgresql.org (Postfix) with SMTP id F01BFD1B510 for ; Wed, 15 Oct 2003 16:48:47 -0300 (ADT) Received: (qmail 20751 invoked from network); 16 Oct 2003 02:48:40 +0700 Received: from smtp.indo.net.id (202.159.32.81) by smtp-1.indo.net.id with SMTP; 16 Oct 2003 02:48:40 +0700 Received: (qmail 19856 invoked from network); 15 Oct 2003 19:46:15 -0000 Received: from unknown (HELO pop.makassar.indo.net.id) (202.159.23.19) by smtp.indo.net.id with SMTP; 15 Oct 2003 19:46:15 -0000 Received: FROM middinkcomp BY pop.makassar.indo.net.id ; Thu Oct 16 03:57:33 2003 +0700 Message-ID: <002e01c39356$d5885ca0$1f00a8c0@middinkcomp> From: "Muhyiddin A.M Hayat" To: Subject: Calc Date: Thu, 16 Oct 2003 03:59:21 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002B_01C39399.E14BB3A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.2 tagged_above=0.0 required=5.0 tests=BAYES_60, HTML_60_70 X-Spam-Level: * X-Archive-Number: 200310/179 X-Sequence-Number: 15579 This is a multi-part message in MIME format. ------=_NextPart_000_002B_01C39399.E14BB3A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear all, I have below table +-----+--------------------+---------------------+ | id | db |cr | +-----+--------------------+---------------------+ |1 | | 200 | |2 | 100 | | |3 | 100 | | |4 | 150 | | |5 | | 200 | I Would like to calc that balance, and look like +-----+--------------------+---------------------+-----------+ | id | db |cr | bal = | +-----+--------------------+---------------------+-----------+ |1 | | 200 |200 | |2 | 100 | |100 | |3 | 100 | |0 = | |4 | 150 | |-150 | |5 | | 200 |50 = | What can I do to get result like that ------=_NextPart_000_002B_01C39399.E14BB3A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear all,
 
I have below table
 
+-----+--------------------+---------------------+
 | id   |  &= nbsp;=20 db            &= nbsp;      =20 |cr              &nb= sp;=20           |
+-----+--------------------+---------------------+
 |1    =20 |       =20             &nb= sp;      =20 | 200           = ;          =20 |
 |2    =20 | 100           = ;        =20 |            &n= bsp;            = ;    =20 |
 |3    =20 | 100           = ;        =20 |            &n= bsp;            = ;    =20 |
 |4    =20 | 150           = ;        =20 |            &n= bsp;            = ;    =20 |
 |5    =20 |       =20             &nb= sp;      =20 | 200           = ;          =20 |
 
I Would like to calc that balance, and loo= k=20 like
 
+-----+--------------------+---------------------+-----------+
 | id   |  &= nbsp;=20 db            &= nbsp;      =20 |cr              &nb= sp;=20           |=20 bal        |
+-----+--------------------+---------------------+-----------+
 |1    =20 |       =20             &nb= sp;      =20 | 200           = ;          =20 |200       |
 |2    =20 | 100           = ;        =20 |            &n= bsp;            = ;    =20 |100       |
 |3    =20 | 100           = ;        =20 |            &n= bsp;            = ;    =20 |0           =20 |
 |4    =20 | 150           = ;        =20 |            &n= bsp;            = ;    =20 |-150      |
 |5    =20 |       =20             &nb= sp;      =20 | 200           = ;          =20 |50         |
 
 
What can I do to get result like that
 
 
 
 
 
 
 
 
 
 
------=_NextPart_000_002B_01C39399.E14BB3A0--