RE: Concatenar datos

From: Edwin Quijada <listas_quijada(at)hotmail(dot)com>
To: <svh(dot)pgsql(at)gmail(dot)com>, <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: <jgromero(at)gmail(dot)com>, <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: RE: Concatenar datos
Date: 2009-08-17 19:58:37
Message-ID: BLU137-W70DF959A3A51F9B26BC83E3010@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda


array_agg solo se puede usar en 8.4?

*-------------------------------------------------------*
*-Edwin Quijada
*-Developer DataBase
*-JQ Microsistemas

*-Soporte PostgreSQL

*-www.jqmicrosistemas.com
*-809-849-8087
*-------------------------------------------------------*

----------------------------------------
> Date: Mon, 17 Aug 2009 09:14:28 -0400
> Subject: Re: [pgsql-es-ayuda] Concatenar datos
> From: svh(dot)pgsql(at)gmail(dot)com
> To: alvherre(at)alvh(dot)no-ip(dot)org
> CC: jgromero(at)gmail(dot)com; pgsql-es-ayuda(at)postgresql(dot)org
>
> Gracias a todos por su ayuda, ya que es exactamente lo que necesitaba.
>
> saludos,
>
> El 16 de agosto de 2009 20:22, Alvaro Herrera escribió:
>> Alvaro Herrera escribió:
>>> Juan Romero escribió:
>>>
>>>> Si. Utilizando funciones agregadas[1]. En la lista hace algun tiempo
>>>> Alvaro Herrera dejo una funcion que, me parece, hace justamente eso
>>>> que necesitas[2]
>>>
>>> Ese es un mecanismo que quedó obsoleto desde que se puede usar
>>> array_agg. En ese mismo thread creo que alguien explicó cómo se hacía.
>>
>> No lo vi así que aquí lo pongo:
>>
>> alvherre=# create table test (a int);
>> iCREATE TABLE
>> alvherre=# insert into test values (1), (2), (3);
>> INSERT 0 3
>> alvherre=# select array_agg(a) from test;
>> array_agg
>> -----------
>> {1,2,3}
>> (1 fila)
>>
>> alvherre=# select array_to_string(array_agg(a), ' - ') from test;
>> array_to_string
>> -----------------
>> 1 - 2 - 3
>> (1 fila)
>>
>>
>> --
>> Alvaro Herrera http://www.advogato.org/person/alvherre
>> "Ah, spring... when a young penguin's fancy lightly turns to thoughts of ...
>> Beta testing!" (Fedora 9 beta announcement)
>>
> --
> TIP 5: ¿Has leído nuestro extenso FAQ?
> http://www.postgresql.org/docs/faqs.FAQ.html
_________________________________________________________________

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Nahum Castro 2009-08-17 20:54:23 Parametros en make
Previous Message Alvaro Herrera 2009-08-17 18:44:37 Re: ERROR: wrong record type supplied in RETURN NEXT