SQL function to get count of how many times string appears in column?

Posted by Kristopher Ives on Stack Overflow See other posts from Stack Overflow or by Kristopher Ives
Published on 2010-06-13T08:02:11Z Indexed on 2010/06/13 8:12 UTC
Read the original article Hit count: 217

Filed under:
|
|
|
|

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 word', `my_column`) AS `match_count`
FROM `table`

Thanks!

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql