Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 23 Aug 2012 @ 22:22:41 GMT


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


Subj:   Re: Number of times a string appears in a sentence
 
From:   Dieter Noeth

Satyendra.Kumar wrote:

  How can we find the number of times a string appears in a sentence? Example: I am using a complex view which uses joins many times in the query. I just want to count how many times 'JOIN' keyword appeared in the view.  


If you already got the oReplace UDF:

     (char_length(x) - char_length(oReplace(upper(x), 'JOIN', '')) /
     char_length('JOIN')

Dieter



     
  <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