|
|
Archives of the TeradataForum
Message Posted: Tue, 14 Mar 2006 @ 16:44:54 GMT
Subj: | | Re: Trimming Spaces Between Charachter |
|
From: | | Frank O Connor |
Hi
You could try the approach below. However, it is not pretty but illustrates one way to skin that cat!
SELECT
'a bc d' as test
, case when substr(test, 1,1) = ' ' then '' else substr(test, 1,1) end
||
case when substr(test, 2,1) = ' ' then '' else substr(test, 2,1) end ||
case when substr(test, 3,1) = ' ' then '' else substr(test, 3,1) end ||
case when substr(test, 4,1) = ' ' then '' else substr(test, 4,1) end ||
case when substr(test, 5,1) = ' ' then '' else substr(test, 5,1) end ||
case when substr(test, 6,1) = ' ' then '' else substr(test, 6,1) end ||
case when substr(test, 7,1) = ' ' then '' else substr(test, 7,1) end as
new_text
Good luck
Frank
| |