Re: Concat two fields into one at runtime - Mailing list pgsql-sql

From Oisin Glynn
Subject Re: Concat two fields into one at runtime
Date
Msg-id 448848B8.8010406@oisinglynn.com
Whole thread Raw
In response to Concat two fields into one at runtime  (George Handin <postgresql@dafunks.com>)
List 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
if you want the 2 fields with a space between them

select first ||' '||last as name from foo;

should do it.

Oisin



pgsql-sql by date:

Previous
From: Bricklen Anderson
Date:
Subject: Re: Concat two fields into one at runtime
Next
From: "Philippe Lang"
Date:
Subject: pgxml & xpath_table