Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 28 Jun 2005 @ 21:15:11 GMT


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


Subj:   Re: Comma in string
 
From:   Alexander, Ruth

Utilizing Mike's comment, I wrote the following statement to count over from the first position to the comma, then dumped this in a 'city' field, however this included the comma at the end. I put in a ', -1' after the Position function below (trying it both inside and outside the parentheses at the end and all other ways I could think of), but it threw errors, complaining about the format. So I set a field equal to the comma's position, named POS and then subtracted 1 from that and it worked well, but shouldn't the statement below work, with there being a way to subtract out the comma with a -1 in the substr?

     select substr(trim(address_Z), 1, position(',' in address_Z))
        from sp.tl_116870_v4;

Thanks.



     
  <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