Count a specific word in a MySQL row

 

I needed to count a specific word  in MySQL. I want to share this query may be someone will need it. Here is this,

 

Select (length(`Coloumn_NAME`)-length(replace(`Coloumn_NAME`,’KEYWORD’,”)))/(LENGTH(‘KEYWORD’)) FROM TABLE_NAME  WHERE …

 

 

Yazar: Yasin