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)

Artificial Intelligence Meta

Q&A about the site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

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 >= 120000 and a.id < 130000)
 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