With topTags As ( Select Top 40 t.tagId From postTags t G...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

With topTags As (
  Select Top 40 t.tagId
  From postTags t
  Group By t.tagId
  Order By Count(*) Desc
)


select t.TagName, sum(a.Score) as Score from Posts q
join Posts a on  a.ParentId = q.Id 
join PostTags pt on q.id = pt.PostId
join Tags t on t.id = pt.TagId

where pt.TagId in (select * from topTags)
and a.CommunityOwnedDate is null 
and a.OwnerUserId = ##UserId##

group by t.TagName
order by Score desc

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached