Re: dynamic crosstab - Mailing list pgsql-general

From Balázs Klein
Subject Re: dynamic crosstab
Date
Msg-id 20080215164012.390B0ACB77@mail00a.mail.t-online.hu
Whole thread Raw
In response to Re: dynamic crosstab  (Erik Jones <erik@myemma.com>)
List pgsql-general

> -----Original Message-----
> > Do youthink there is a way to ensure that the order of the values in the
> > array below is the same for each person?
> >
> > tbl(eID, aID, value)
> >
> > Select eID, array_accum(value) from
> > (
> >  (Select Distinct eID from tbl) e
> >   CROSS JOIN
> >  (Select Distinct aID from tbl) a
> > ) ea
> >  LEFT OUTER JOIN
> > tbl USING (eID, aID)
> > GROUP BY eID
>
> The only way to ever guarantee a particular order is via an ORDER BY
> clause.

Sure. I just didn’t know where to put it - most aggregates don't care about the row order, but for this one it is
important.


pgsql-general by date:

Previous
From: paul rivers
Date:
Subject: Re: Pains in upgrading to 8.3
Next
From: Tom Lane
Date:
Subject: Re: Pains in upgrading to 8.3