X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E0A8A9FA5CE for ; Thu, 8 Jun 2006 12:54:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 71896-07 for ; Thu, 8 Jun 2006 12:54:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from presinet.com (mail.presinet.com [209.53.156.1]) by postgresql.org (Postfix) with ESMTP id 1B11F9F9EF3 for ; Thu, 8 Jun 2006 12:54:07 -0300 (ADT) Received: from [10.10.1.151] ([10.10.1.151]) by presinet.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 8 Jun 2006 08:54:25 -0700 Message-ID: <44884822.8020109@presinet.com> Date: Thu, 08 Jun 2006 08:54:10 -0700 From: Bricklen Anderson User-Agent: Thunderbird 1.5.0.2 (X11/20060522) MIME-Version: 1.0 To: George Handin CC: pgsql-sql@postgresql.org Subject: Re: Concat two fields into one at runtime References: <44884736.3080309@dafunks.com> In-Reply-To: <44884736.3080309@dafunks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Jun 2006 15:54:25.0031 (UTC) FILETIME=[D0CC0970:01C68B13] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/98 X-Sequence-Number: 25334 George Handin wrote: > Is there a way using built-in PostgreSQL functions to combine two data > fields into a single field at runtime when querying data? > > For example, the query now returns: > > id first last > --- ------- ---------- > 1 Goerge Handin > 2 Joe Rachin > > I'd like it to return: > > id name > --- ------------------- > 1 George Handin > 2 Joe Rachin select id,first||' '||last from your_table