Re: [SQL] order function in aggregate

2008-08-20 Thread Mike Toews
Richard Huxton wrote: Michael Toews wrote: You could accumulate the values in an array and then sort that with the final-func that create aggregate supports. Thanks for the help. Here was my final functions to aggregate things into a comma serpented text element (if anyone is interested):

Re: [SQL] order function in aggregate

2008-07-30 Thread Tom Lane
Richard Huxton <[EMAIL PROTECTED]> writes: > Michael Toews wrote: >> This is where I get confused, since in the aggregate function, I have >> specified `SORTOP="<"`, which according to the documentation >> (http://www.postgresql.org/docs/8.3/interactive/sql-createaggregate.html) >> "must be equi

Re: [SQL] order function in aggregate

2008-07-30 Thread Richard Huxton
Michael Toews wrote: Now, I would like to group a summary of the strings in "sub", but they must be ordered alphabetically. Here I attempt the SQL: select commacat(sub), grp from aggr_test group by grp; However, on my system it will output the "commacat" column as: "one, two, three";"pom

[SQL] order function in aggregate

2008-07-30 Thread Michael Toews
Hi, I'm relatively new to object oriented databases and postgres (~ 4 months), so I'm not sure what is wrong with my custom aggregate function. I'm using Postgres 8.3.3 (results are same on Windows and Ubuntu versions). Here is my data required to explain my problem: