Returns counts of pairs of tags, which occur in the same question.
Q&A for people looking to bypass life's everyday problems with simple tricks
-- Returns tag pairs count: -- (Tag1 Name), (Tag2 Name), (Cont: Tag1 and Tag2 are in the same post), -- e.g.: -- javascript, jquery, 74240 -- .net, c#, 63251 -- iphone, objective-c, 43541 -- ... DECLARE @MinCounts int = ##MinCounts## -- For StackOverflow 1000 is a typical value -- For other StackExachange sites you can safely use 0 SELECT -- TOP 100 T1.TagName Tag1, T2.TagName Tag2, count(*) TagPairCount FROM Posts P INNER JOIN PostTags PT1 ON PT1.PostId = P.Id INNER JOIN PostTags PT2 ON PT2.PostId = P.Id INNER JOIN Tags T1 ON T1.Id = PT1.TagId INNER JOIN Tags T2 ON T2.Id = PT2.TagId WHERE T1.TagName < T2.TagName GROUP BY T1.TagName, T2.TagName HAVING count(*) >= @MinCounts ORDER BY TagPairCount DESC