Total Number of String Counts



IBM's flagship relational database management system

Total Number of String Counts

Postby tdanielxyz » Sat Sep 07, 2019 9:44 pm

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.
tdanielxyz
 
Posts: 12
Joined: Sun Oct 17, 2010 12:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Total Number of String Counts

Postby tdanielxyz » Sun Sep 08, 2019 1:19 am

I used the SUBSTR function and was able to find the total occurrences of the string in the table column in QMF
tdanielxyz
 
Posts: 12
Joined: Sun Oct 17, 2010 12:06 am
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post