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?
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.
--
- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
- Mi sitio sobre programación web: http://bits.demogracia.com
- Mi web de humor al baño María: http://www.demogracia.com --