On Nov 7, 2005, at 17:47 , David Fetter wrote:
On Mon, Nov 07, 2005 at 05:12:05PM +0900, Michael Glaesmann wrote:
I'm trying to concatenate strings in variable orders using a custom
aggregate. However, I'm having a difficult time figuring out the
SQL I need to use to accomplish this.
How
I'm trying to concatenate strings in variable orders using a custom
aggregate. However, I'm having a difficult time figuring out the SQL
I need to use to accomplish this. Here's a test case that shows the
error I'm getting.
select version();
On Mon, Nov 07, 2005 at 05:12:05PM +0900, Michael Glaesmann wrote:
I'm trying to concatenate strings in variable orders using a custom
aggregate. However, I'm having a difficult time figuring out the
SQL I need to use to accomplish this.
How about using the ARRAY() constructor as below?
Michael Glaesemann wrote:
I'm trying to concatenate strings in variable orders using a custom
aggregate. However, I'm having a difficult time figuring out the SQL I
need to use to accomplish this. Here's a test case that shows the error
I'm getting.
select bar_id, array_accum(foo_value)
On Nov 7, 2005, at 17:40 , Roger Hand wrote:
On Monday, November 07, 2005 12:12 AM
Michael Glaesemann wrote:
select bar_id, array_accum(foo_value)
from ordered_foo
group by bar_id
order by bar_id;
bar_id | array_accum
+-
1 |
On Monday, November 07, 2005 12:12 AM
Michael Glaesemann wrote:
select bar_id, array_accum(foo_value)
from ordered_foo
group by bar_id
order by bar_id;
bar_id | array_accum
+-
1 | {delta,alpha,charlie,bravo}
2 | {C,B,A,D}
The
Joe Conway [EMAIL PROTECTED] writes:
Michael Glaesemann wrote:
I'm trying to concatenate strings in variable orders using a custom
aggregate.
Just use a subselect -- you're looking for this, correct?
regression=# select bar_id, array_accum(foo_value) from (select * from
ordered_foo
On Nov 7, 2005, at 23:24 , Tom Lane wrote:
Strictly speaking, you need this:
select bar_id, array_accum(foo_value) from
(select * from ordered_foo order by bar_id, foo_pos) as ss
group by bar_id order by bar_id;
ie, sort the subselect by the grouping key of the outer
Michael Glaesemann [EMAIL PROTECTED] writes:
On Nov 7, 2005, at 23:24 , Tom Lane wrote:
Strictly speaking, you need this:
select bar_id, array_accum(foo_value) from
(select * from ordered_foo order by bar_id, foo_pos) as ss
group by bar_id order by bar_id;
ie, sort the