user1259446
user1259446

Reputation:

Count the number of times keywords appear in a mysql column

Ok I have a database table in which i collect the keywords which people use to visit my website, all of these keywords are stored in the column string.

Now what i want to do is count the words and group them by the number of times they are used, so for example if marketing is used six times i want to output to a table Marketing 6.

My problem is not sure if there is a function that will allow mysql to count all of the instances of words and then add them up.

And if not is there a way this can be done?

Upvotes: 0

Views: 1063

Answers (1)

DKSan
DKSan

Reputation: 4197

As far as i have understood your question, you are searching something like this:

SELECT COUNT(*), KEYWORD FROM TABLE GROUP BY KEYWORD

Upvotes: 3

Related Questions