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 151579FA5C8 for ; Thu, 8 Jun 2006 12:53:56 -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 72396-01 for ; Thu, 8 Jun 2006 12:53:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.171]) by postgresql.org (Postfix) with ESMTP id C27F09F9EF3 for ; Thu, 8 Jun 2006 12:53:51 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id j40so852373ugd for ; Thu, 08 Jun 2006 08:53:50 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=GiaSBIyYJ1wkVMadurcAtfJqPQAl6Kl9ZHiS5WhfVnGznJ0++3765GXXaMwP1C9X5iH+v18Xiy1TPAj5m88XK1oYBm+9x3XF6quRaPBXOTGv9bpib95OEhlC7oMU+kBNuJuXL/Apj/DY4Y0WqTJl+gl63KTScImcRXZiDfaObM8= Received: by 10.66.222.9 with SMTP id u9mr1657718ugg; Thu, 08 Jun 2006 08:53:50 -0700 (PDT) Received: by 10.67.20.12 with HTTP; Thu, 8 Jun 2006 08:53:50 -0700 (PDT) Message-ID: Date: Thu, 8 Jun 2006 10:53:50 -0500 From: "Aaron Bono" To: "George Handin" Subject: Re: Concat two fields into one at runtime Cc: pgsql-sql@postgresql.org In-Reply-To: <44884736.3080309@dafunks.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3328_10127862.1149782030462" References: <44884736.3080309@dafunks.com> X-Google-Sender-Auth: 8b393a9353c65c99 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/97 X-Sequence-Number: 25333 ------=_Part_3328_10127862.1149782030462 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline select id, first || ' ' || last from mytable; On 6/8/06, 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > ------=_Part_3328_10127862.1149782030462 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline select id, first || ' ' || last
from mytable;

On 6/8/06, George Handin <postgresql@dafunks.com> 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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings


------=_Part_3328_10127862.1149782030462--