Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Tue, 06 Jun 2006 @ 09:47:54 GMT





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




Subj:   To find the n th instance of a character in a string
 
From:   Mukkamala, Kotesh



Is there a way to find the nth instance of a character in a string. Something like the INSTR function in Oracle.

I know the

     index(substr(transaction_code,index(transaction_code,'&') +1) ,'&') +
     index(transaction_code,'&')

can find the 2nd instance but what about the 3rd and 10th instance. The SQL can get pretty complex and un-developer friendly.


Regards,

Kotesh Mukkamala
Teradata Certified Master





     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008