Re: Concatenation with separator

From: Álvaro G. Vicario <alvaro.NOSPAMTHANX_at_demogracia.com>
Date: Wed, 04 Feb 2009 19:03:50 +0100
Message-ID: <gmclad$j0b$1_at_news.motzarella.org>



ddf escribió:
> SQL> select concat_add
> 2 from
> 3 (select country||';'||city||';'||street concat_add, rownum rn
> 4 from location
> 5 where country is not null
> 6 and city is not null
> 7 and street is not null
> 8 union
> 9 select country||';'||city concat_add, rownum rn
> 10 from location
> 11 where country is not null
> 12 and city is not null
> 13 and street is null
> 14 union
> 15 select country||';;'||street concat_add, rownum rn
> 16 from location
> 17 where country is not null
> 18 and street is not null
> 19 and city is null
> 20 union
> 21 select country concat_add, rownum rn
> 22 from location
> 23 where city||street is null)
> 24 order by rn;

[...]
> There may be a more elegant solution, I simply don't have any more
> time to work on this.

My own workaround for a specific application I just had to finish ASAP was an chaotic series of CASE ... END statements that would scare you away. That's why I'm longing for something more, well, elegant.

Thank you for your time.

-- 
-- 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
--
Received on Wed Feb 04 2009 - 12:03:50 CST

Original text of this message