X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F079C474E44 for ; Fri, 7 Feb 2003 05:00:12 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id AF504474E5C for ; Fri, 7 Feb 2003 05:00:01 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Fri Feb 07 10:59:52 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id KAA15473; Fri, 7 Feb 2003 10:59:50 +0100 (MET) Message-ID: <3E438396.2983BD2B@rodos.fzk.de> Date: Fri, 07 Feb 2003 10:59:50 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: liongliong@telkom.net Subject: Re: conversi ms-sql7 vs postgresql 7.3 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/145 X-Sequence-Number: 11543 > > I have table xx: > id debet credit balance > 1 1000 0 0 > 2 2000 0 0 > 3 0 2500 0 > 4 0 100 0 > > command in ms-sql 7 can use calculate field (column) balance from id=1 to > id=4: > "update xx set bal=balance=bal+debet-credit" > result: > id debet credit balance > 1 1000 0 1000 > 2 2000 0 3000 > 3 0 2500 500 > 4 0 100 400 > > How command sql can use in psotgresql 7.3? > Try UPDATE xx SET balance=balance+debet-credit ; Regards, Christoph