pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Leif B. Kristensen <leif@solumslekt.org>
To: pgsql-sql@postgresql.org
Subject: Re: Concatenation through SQL
Date: Fri, 21 Dec 2007 13:31:14 +0100
Message-ID: <200712211331.14239.leif@solumslekt.org> (raw)
In-Reply-To: <520638AC-01E3-48C6-A480-DEB5E56139E5@tele2.se>
References: <6C0CF58A187DA5479245E0830AF84F42337F97@poweredge.attiksystem.ch>
	<200712211216.45186.leif@solumslekt.org>
	<520638AC-01E3-48C6-A480-DEB5E56139E5@tele2.se>

On Friday 21. December 2007, Niklas Johansson wrote:

>select array_to_string(array[given, patronym, toponym], ' ') from
>persons where person_id=57;
>
>Notice the use of the array[] constructor, instead of the array()
>constructor, which must be fed a subquery which returns only one
> column.

Aah, great!

pgslekt=> select array_to_string(array[given, patronym, toponym], ' ') 
from persons where person_id=57;
     array_to_string
--------------------------
 Abraham Jonsen Bjørntvet
(1 row)

Tackar och bockar!
-- 
Leif Biberg Kristensen | Registered Linux User #338009
http://solumslekt.org/ | Cruising with Gentoo/KDE
My Jazz Jukebox: http://www.last.fm/user/leifbk/



view thread (10+ messages)  latest in thread

Message-ID: <200712211331.14239.leif@solumslekt.org>
Permalink:  ../200712211331.14239.leif@solumslekt.org/
Also on:    postgresql.org/message-id/200712211331.14239.leif@solumslekt.org

 · 

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: leif@solumslekt.org
  Subject: Re: Concatenation through SQL
  In-Reply-To: <200712211331.14239.leif@solumslekt.org>

* 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