Search Postgresql Archives

Re: Order By for aggregate functions (Simulating Group_concat)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 01, 2005 at 10:04:12AM +0100, Charlotte Pollock wrote:
> Hi All
> 
> I'm trying to create a aggregate function similar 9but not identical) to
> mysql's group_concat.
> 
> What I want to be able to do is pass and order by field to the aggregate so
> I can be certain I get the list of strings in the correct order.

Order them before the aggregate?

SELECT aggregate(field) FROM (SELECT field FROM xxx ORDER BY wherever) x;

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgpOdCKvV1xic.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux