|
|
Archives of the TeradataForum
Message Posted: Thu, 19 Jul 2012 @ 09:20:45 GMT
Subj: | | Re: How to delete special characters in a string |
|
From: | | Lenka, Dipti Prakash |
Hi Vinod,
Hope this below given query will help you.
Lets say Col5 is having value like 'asgja/gahsg/ass'
SELECT
CASE
WHEN POSITION('/' IN Col5) > 0 THEN
SUBSTRING(Col5 FROM 1 FOR POSITION('/' IN Col5) - 1) || ',' ||
SUBSTRING(Col5 FROM POSITION('/' IN Col5) + CHARACTER_LENGTH('/'))
ELSE Col5
END Col5
FROM ttmp.dipti ;
Thanks,
Dipti Prakash
| |