mysql - How to get rows from articles table 10 most popular tags? -


I have a table article with article name and paragraph tags in my database. Article tag is a string column in which tags are: "People, Life, President". Every article has been tagged in this fashion.

Now I want to get 10 most popular tags for the entire population of articles. How to do this

If you have a possibility, change your database schema for a table of articles better, A tag table and an article_tags table.

This will allow more efficient matching of tags (like you want to do), especially if you have many articles.

With your current design, you want to completely run on the (possibly large) article table, and retain the tag pile (either through a floating table - in which case You can do this through a stored procedure - or in the application code). The whole will actually be disabled.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -