Re: summing tables - Mailing list pgsql-sql

From Greg Stark
Subject Re: summing tables
Date
Msg-id 87u19nls0i.fsf@stark.dyndns.tv
Whole thread Raw
In response to summing tables  (Erik Thiele <erik@thiele-hydraulik.de>)
List pgsql-sql
"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



pgsql-sql by date:

Previous
From: "Viorel Dragomir"
Date:
Subject: Re: summing tables
Next
From: greg@turnstep.com
Date:
Subject: Re: Count dates distinct within an interval