1

Topic: Count of an amount of entrances of a word or expression in fields

All greetings
In SQL I do not understand (((faced a problem, for the help of thanks!
I need to count an amount of entrances of a word in the field of the table, I do so:

SELECT COUNT (*)
FROM wp_posts
WHERE post_content LIKE ' % % '

As a result considers only lines with entrances, instead of a amount of entrances

2

Re: Count of an amount of entrances of a word or expression in fields

SELECT SUM ((LENGTH (post_content)-LENGTH (REPLACE (post_content, '  ', ")))/LENGTH ('  '))
FROM wp_posts
WHERE post_content LIKE ' % %'

3

Re: Count of an amount of entrances of a word or expression in fields

Many thanks!