Is there a function for MySQL that will count the number of times a string occurs in another string or column? Basically I want:
SELECT
SUB_COUNT(\'my wo
I think you may be able to use the following example. I was trying to count the number of times a particular carton type was used when shipping.
SELECT carton_type, COUNT(carton_type) AS match_count
FROM carton_hdr
WHERE whse ='wh1'
GROUP BY "carton_type"
Your scenario:
SELECT my_column COUNT(my_column)
FROM my_table
WHERE my_column = 'my_word'
GROUP BY my_column
If you take out the "where" function, it will count the number of times each distinct entry appears in "my_column".