Re: Why can't I use windowing functions over ordered aggregates? - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: Why can't I use windowing functions over ordered aggregates?
Date
Msg-id 51C48964.1050100@agliodbs.com
Whole thread Raw
In response to Why can't I use windowing functions over ordered aggregates?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
Cedric,

> See this example:
> # create table foo (i int, t timestamptz);
> # insert into foo select n, now() from generate_series(1,10) g(n);
> # select i, first_value(i) over (order by t desc) from foo;
> # select i, first_value(i) over (order by t desc ROWS between 0 PRECEDING and 
> UNBOUNDED FOLLOWING) from foo;
> 
> What do you expect "SELECT first(val order by ts desc)" to output ?
> 

Ah, right, I see what you mean.  Yeah, I was doing queries without peer
rows, so it looked the same to me, and it uses some of the same
machinery.  But of course it's not completely the same.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com



pgsql-hackers by date:

Previous
From: David Johnston
Date:
Subject: Re: Why can't I use windowing functions over ordered aggregates?
Next
From: David Fetter
Date:
Subject: Review [was Re: MD5 aggregate]