Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 49956476E76 for ; Fri, 20 Sep 2002 11:10:20 -0400 (EDT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id C0860476E3E for ; Fri, 20 Sep 2002 11:10:19 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id E14A5D61B; Fri, 20 Sep 2002 08:09:22 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id D2E7C5C02; Fri, 20 Sep 2002 08:09:22 -0700 (PDT) Date: Fri, 20 Sep 2002 08:09:22 -0700 (PDT) From: Stephan Szabo To: =?iso-8859-1?B?UmljYXJkbyBKYXZpZXIgQXJhbmliYXIgTGXzbg==?= Cc: , Subject: Re: query concat In-Reply-To: Message-ID: <20020920080218.W40440-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/244 X-Sequence-Number: 9521 On Fri, 20 Sep 2002, [iso-8859-1] Ricardo Javier Aranibar Le=F3n wrote: > Hi List, > First, Thanks for your colaboration Richard Huxton "Do a search on aggreg= ate > functions and "concat" in the mailing list archives, > also see the Postgresql Cookbook on techdocs.postgresql.org, I think there > might be something there for you." > > I have been written this mail because I din't find the solution for my > problem. For example, an aggregate like: http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id= =3D139 (available in the aggregates section of the cookbook - note there's a bug and you need to double the quotes around the ', ') Then you can use a left join and the comma aggregate, something like: select ticket.numtti, ticket.tt, ticket.usuario, ticket.estado, comma(order_respuesta.numorden) from ticket left outer join orden_respuesta on (tti=3Dnumtti) group by ticket.numtti, ticket.tt, ticket.usuario, ticket.estado;