Tags and Top 25 Related Tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

Moderators

Q&A for community managers, administrators, and moderators

select * from (SELECT  
  ROW_NUMBER() OVER(PARTITION BY A.ID ORDER BY A.ID, count(B.TagName) DESC) AS Row,
  A.ID, A.TagName as Tag1, B.TagName as Tag2, count(B.TagName) as cnt
 FROM 
  Tags as A, Tags as B, PostTags as C, PostTags as D
 WHERE 
  A.id != b.id and
  (C.PostId=D.PostId and C.TagId=A.id and D.TagId=B.id) and (a.id >= 1 and a.id <= 2000)
 GROUP BY
 A.ID,A.TagName,b.tagname) g where row <= 25 order by id

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results