select * from (SELECT ROW_NUMBER() OVER(PARTITION BY A.ID...

0

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

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 < 10000)
 GROUP BY
 A.ID,A.TagName,b.tagname) g where row <= 10

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results