X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id EC03ECC3C6 for ; Tue, 15 Jul 2003 15:38:09 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 29412-06 for ; Tue, 15 Jul 2003 15:38:28 +0000 (GMT) Received: from sabre.velocet.net (sabre.velocet.net [216.138.209.205]) by svr1.postgresql.org (Postfix) with ESMTP id A0F94CC3F5 for ; Tue, 15 Jul 2003 12:37:58 -0300 (ADT) Received: from stark.dyndns.tv (H162.C233.tor.velocet.net [216.138.233.162]) by sabre.velocet.net (Postfix) with ESMTP id 70C871390C7; Tue, 15 Jul 2003 11:38:22 -0400 (EDT) Received: from localhost ([127.0.0.1] helo=stark.dyndns.tv ident=foobar) by stark.dyndns.tv with smtp (Exim 3.36 #1 (Debian)) id 19cRsj-0005ha-00; Tue, 15 Jul 2003 11:38:21 -0400 To: "Viorel Dragomir" Cc: "Greg Stark" , Subject: Re: summing tables References: <20030715140921.7c5a6a6c.erik@thiele-hydraulik.de> <001501c34aca$e70ca280$0600a8c0@fix.ro> <20030715143925.54716ed4.erik@thiele-hydraulik.de> <007101c34ad6$3e0249e0$0600a8c0@fix.ro> <878yqzn8k5.fsf@stark.dyndns.tv> <010201c34ae2$b35b3830$0600a8c0@fix.ro> In-Reply-To: <010201c34ae2$b35b3830$0600a8c0@fix.ro> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 15 Jul 2003 11:38:21 -0400 Message-ID: <87u19nls0i.fsf@stark.dyndns.tv> Lines: 20 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/184 X-Sequence-Number: 14298 "Viorel Dragomir" writes: > Anyway, in real life this update modifies only one row with a value wich is > diff of null. It was really handy if it was specified the option ORDER for > the update command. Are you hoping to produce a running total? That's very difficult in standard SQL. That would be very different from the query you asked for. Running totals, ranking, lead/lag, are all things that are very difficult to do in standard SQL. They don't fit in the unordered set model that SQL follows so doing them without special non-standard functions is very hard and inefficient. The functions to do them don't fit well within the SQL universe either, which might be why they don't exist yet in postgres. -- greg