pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bricklen Anderson <banderson@presinet.com>
To: George Handin <postgresql@dafunks.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Concat two fields into one at runtime
Date: Thu, 08 Jun 2006 08:54:10 -0700
Message-ID: <44884822.8020109@presinet.com> (raw)
In-Reply-To: <44884736.3080309@dafunks.com>
References: <44884736.3080309@dafunks.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <44884822.8020109@presinet.com>
Permalink:  ../44884822.8020109@presinet.com/
Also on:    postgresql.org/message-id/44884822.8020109@presinet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: banderson@presinet.com, postgresql@dafunks.com
  Subject: Re: Concat two fields into one at runtime
  In-Reply-To: <44884822.8020109@presinet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox