Re: concatenate text

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Sterpu Victor <victor(at)ambra(dot)ro>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: concatenate text
Date: 2005-09-05 06:05:51
Message-ID: 1125900351.6682.34.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Montag, den 05.09.2005, 03:00 +0300 schrieb Sterpu Victor:
> Can I do something like this?
> SELECT sum(name) FROM table;
>
> Where name is a text field.
> I know 'sum' doesn't work, but is there another solution?
> '||' is not good because it will take just 2 arguments.
>

Yes you can write an aggregate using built in textcat()
function or via array_append() if you are bulding an
array first and translate it into a string on output
of your aggregate. (This should be faster, I personally
used the version with textcat)

Regards
Tino

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Berend Tober 2005-09-05 07:30:30 Re: concatenate text
Previous Message Tony Caduto 2005-09-05 03:40:50 Re: Embed PostgreSQL in application