Re: Concatenation with separator
From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 4 Feb 2009 15:46:04 -0700
Message-ID: <498a28bc$1_at_news.victoria.tc.ca>
=?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= (alvaro.NOSPAMTHANX_at_demogracia.com) wrote:
: 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: 4 Feb 2009 15:46:04 -0700
Message-ID: <498a28bc$1_at_news.victoria.tc.ca>
=?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?= (alvaro.NOSPAMTHANX_at_demogracia.com) wrote:
: 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.:
assuming the separator cannot be the last character of any of the columns, e.g.
rtrim( nvl2( col1 , col1||';', '') || nvl2( col2 , col2||';', '') || nvl2( col3 , col3||';', '') || col4 , ';')Received on Wed Feb 04 2009 - 16:46:04 CST