On Monday 30 March 2009 15:34:49 David Fetter wrote:
> On Mon, Mar 30, 2009 at 01:31:23PM -0400, Tom Lane wrote:
> > David Fetter writes:
> > > SELECT
> > > i,
> > > t,
> > > RANK() OVER (
> > > PARTITION BY i
> > > ORDER BY random()
> > > )
> > > FROM foo;
> > > ER
On Mon, Mar 30, 2009 at 01:31:23PM -0400, Tom Lane wrote:
> David Fetter writes:
> > SELECT
> > i,
> > t,
> > RANK() OVER (
> > PARTITION BY i
> > ORDER BY random()
> > )
> > FROM foo;
> > ERROR: ORDER/GROUP BY expression not found in targetlist
>
> Fixed.
Thanks
David Fetter writes:
> SELECT
> i,
> t,
> RANK() OVER (
> PARTITION BY i
> ORDER BY random()
> )
> FROM foo;
> ERROR: ORDER/GROUP BY expression not found in targetlist
Fixed.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsq
Folks,
Robert Treat brought this up.
I create a table with something to partition by, and some meaningless
junk. I'm trying to get a random ordering inside each window:
CREATE TABLE foo(i, t) AS
SELECT i, md5((i*generate_series(1,10))::text) /* Nonsense text */
FROM generate_series(10,1) i;
SE