There is currently no built-in function to do this, so I use:

SELECT LENGTH( 'THIS TEST' ) - LENGTH( REPLACE ('THIS TEST','T','');

Answer output is: 3

How to count the number of occurences in a MySQL string

Leave a Reply

Your email address will not be published. Required fields are marked *

+ nineteen = 20