Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 19 Jul 2012 @ 09:20:45 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023