Cuente la cantidad de veces que aparecen palabras clave en una columna de mysql

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?

preguntado el 09 de marzo de 12 a las 14:03

This should give you some idea.. tizag.com/mysqlTutorial/mysqlcount.php :) -

No se preocupe, me alegro de haber podido ayudar. -

1 Respuestas

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

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

respondido 09 mar '12, 14:03

Hi thanks yes but i don't know what the keywords are, so i just need to group all words in the column string by the number of times entered. - user1259446

In my statement KEYWORD is the name of the Column. If yours is string you can exchange KEYWORD by STRING. - DKSan

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.