Your details

Started by Bruce Momjianover 22 years ago1 messagesgeneral
Jump to latest
#1Bruce Momjian
bruce@momjian.us

See the attached file for details

From pgsql-general-owner@postgresql.org Sun Aug 24 13:16:53 2003

X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org
Received: from localhost (unknown [64.117.224.130])
by svr1.postgresql.org (Postfix) with ESMTP id 660E1D1B4F0
for <pgsql-general-postgresql.org@localhost.postgresql.org>; Sun, 24 Aug 2003 13:16:51 -0300 (ADT)
Received: from svr1.postgresql.org ([64.117.224.193])
by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024)
with ESMTP id 92522-04
for <pgsql-general-postgresql.org@localhost.postgresql.org>;
Sun, 24 Aug 2003 13:16:41 -0300 (ADT)
Received: from wolff.to (wolff.to [66.93.249.74])
by svr1.postgresql.org (Postfix) with SMTP id 59DE6D1D185
for <pgsql-general@postgresql.org>; Sun, 24 Aug 2003 13:16:40 -0300 (ADT)
Received: (qmail 11487 invoked by uid 500); 24 Aug 2003 16:22:30 -0000
Date: Sun, 24 Aug 2003 11:22:30 -0500
From: Bruno Wolff III <bruno@wolff.to>
To: Brian Maguire <bmaguire@vantage.com>
Cc: pgsql-general@postgresql.org
Subject: Re: merge multiple records into 1
Message-ID: <20030824162230.GA11448@wolff.to>
Mail-Followup-To: Brian Maguire <bmaguire@vantage.com>,
pgsql-general@postgresql.org
References: <2F2E24372F10744588A27DEECC85FE040103E7EB@vt-pe2550-001.vantage.vantage.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <2F2E24372F10744588A27DEECC85FE040103E7EB@vt-pe2550-001.vantage.vantage.com>
User-Agent: Mutt/1.5.4i
X-Virus-Scanned: by amavisd-new at postgresql.org
X-Archive-Number: 200308/1285
X-Sequence-Number: 47701

On Sat, Aug 23, 2003 at 20:16:51 -0400,
Brian Maguire <bmaguire@vantage.com> wrote:

What would be the best way to "flatten" a set of records into one column with a query?

example:

You have a table called tbletters

id letters
1 a
2 b
3 c
4 d

So I can return this as one column in one record

a,b,c,d

You could write an aggregate function that concatenates strings. There should
even be examples of some code that does this in the archives from within
the last 6 months.