Page 1 of 1

Total Number of String Counts

PostPosted: Sat Sep 07, 2019 9:44 pm
by tdanielxyz
Can you provide me a query to see the total occurrences of a string say '911' in a DB2 table, say, ABC at a specific position say REC_TXT as one of the columns of the table. The column is 32000 bytes long and is a text format. I am looking for the query to be used in QMF. 911 appears in column 100. I used the Like '% 911%' in a query and it gave me the count. But is there any way to count the value of 911 at specific position of 100 for all records that has a value of 911?

Would like the query that I can use in QMF. Thank you in advance.

Re: Total Number of String Counts

PostPosted: Sun Sep 08, 2019 1:19 am
by tdanielxyz
I used the SUBSTR function and was able to find the total occurrences of the string in the table column in QMF