Sorting items on matching tags that have a weight in MySQL
问题 I'm having a hard time to get to the right query/queries here. When you want to find related items using tags, in MySQL, you can use a 'common tag count' to find items that are most similar. Say my schema looks like this: tags(tag_id, title) articles(article_id, some_text) articles_tags(tag_id, article_id) Then you can get items and sort them on common tags with 'article 2' for example, like this: SELECT at1.article_id, Count(at1.tag_id) AS common_tag_count FROM articles_tags AS at1 INNER