Re: Concatenating string fields with GROUP BY clause
От | Brian G. Huber |
---|---|
Тема | Re: Concatenating string fields with GROUP BY clause |
Дата | |
Msg-id | 001701c376f7$fa6af8a0$6400a8c0@bghmobile обсуждение исходный текст |
Ответ на | Re: Concatenating string fields with GROUP BY clause (Godshall Michael <Michael_Godshall@gmachs.com>) |
Ответы |
Re: Concatenating string fields with GROUP BY clause
|
Список | pgsql-novice |
Thanks for the response - but II does not seem to work as an aggregate function - for example - if I use:
SELECT groupid, sum(numeric_field), ||(text_field) FROM table GROUP BY groupid
I get
ERROR: Unable to identify a prefix operator '||' for type 'text'
You may need to add parentheses or an explicit cast
You may need to add parentheses or an explicit cast
Therefore, I think II concatenates two text columns, but does not aggregate. It would seem this is fairly common but there is no text aggregation function listed in 6.14 Aggregate Functions!!!
----- Original Message -----
From: Godshall MichaelSent: Tuesday, September 09, 2003 12:10 PMSubject: Re: [NOVICE] Concatenating string fields with GROUP BY clauseConcatenate is done with || in postgresql-----Original Message-----
From: Brian G. Huber [mailto:brianghuber@yahoo.com]
Sent: Tuesday, September 09, 2003 12:02 PM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Concatenating string fields with GROUP BY clauseHi -I am trying to concatenate a text field in a query with a group by clause, similar to a sum() function on a numeric value - for example:SELECT groupid, sum(numeric_field), ???(text_field) FROM table GROUP BY groupidbut I cannot find a function that will concatenate the text fields. Any comments appreciated!TIA,BGH
В списке pgsql-novice по дате отправления: