Re: Concat two fields into one at runtime

From: Bricklen Anderson <banderson(at)presinet(dot)com>
To: George Handin <postgresql(at)dafunks(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Concat two fields into one at runtime
Date: 2006-06-08 15:54:10
Message-ID: 44884822.8020109@presinet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Oisin Glynn 2006-06-08 15:56:40 Re: Concat two fields into one at runtime
Previous Message Kenneth B Hill 2006-06-08 15:54:01 Re: Concat two fields into one at runtime