Concatenation with separator

From: Álvaro G. Vicario <alvaro.NOSPAMTHANX_at_demogracia.com>
Date: Wed, 04 Feb 2009 10:08:12 +0100
Message-ID: <gmbltv$ti0$1_at_reader.motzarella.org>



I have a series of VARCHAR2 columns that might be null or not. Is there a simple way to concatenate them using a separator only between non-null values?

E.g.:

COUNTRY CITY DISTRICT STREET
======= ======= ======== ==========
Spain Madrid Chueca
Ukrania
UK London Oxford St.

I'd like:

Spain; Madrid; Chueca
Ukrania
UK; London; Oxford St.

... rather than:

Spain; Madrid; Chueca;
Ukrania; ; ;
UK; London; ; Oxford St.

I'm running Oracle9i Enterprise Edition Release 9.2.0.1.0. Thank you in advance.

--

Received on Wed Feb 04 2009 - 03:08:12 CST

Original text of this message