pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Viorel Dragomir <bc@vio.ro>
Cc: Greg Stark <gsstark@mit.edu>
Cc: pgsql-sql@postgresql.org
Subject: Re: summing tables
Date: 15 Jul 2003 11:38:21 -0400
Message-ID: <87u19nls0i.fsf@stark.dyndns.tv> (raw)
In-Reply-To: <010201c34ae2$b35b3830$0600a8c0@fix.ro>
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>


"Viorel Dragomir" <bc@vio.ro> 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




view thread (13+ messages)  latest in thread

Message-ID: <87u19nls0i.fsf@stark.dyndns.tv>
Permalink:  ../87u19nls0i.fsf@stark.dyndns.tv/
Also on:    postgresql.org/message-id/87u19nls0i.fsf@stark.dyndns.tv

 · 

reply

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: gsstark@mit.edu, bc@vio.ro
  Subject: Re: summing tables
  In-Reply-To: <87u19nls0i.fsf@stark.dyndns.tv>

* 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