How to COUNT co-tags from a tag_map table in mysql?
SELECT t1.TagID AS TagID1
    ,t2.TagID AS TagID2
    ,COUNT(1)
FROM TagMap AS t1
JOIN TagMap AS t2 ON t1.ArticleID = t2.ArticleID AND t1.TagID &lt;&gt; t2.TagID
GROUP BY t1.TagID, t2.TagID


UPDATED: index on ArticleID may help to improve query performance