Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 14 Mar 2006 @ 16:44:54 GMT


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


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



     
  <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