Anti-generalist - lots of votes in question with no tags that are not in the top 40

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

-- Anti-generalist - lots of votes in question with no tags that are not in the top 40
declare @topTags int = ##topTags:int##, 
  @minScore int = ##minScore:int##

select distinct PostId 
into #t
from PostTags
where TagId in
(select top (@topTags) Id from Tags order by Count desc )

select u.Id as [User Link], u.Reputation, Score from Users u
join 
(
select top 100 percent a.OwnerUserId , sum(a.Score) Score
from Posts q 
join Posts a on a.ParentId = q.Id
where a.CommunityOwnedDate is null and q.ClosedDate is null 
and q.PostTypeId = 1
and q.Id not in (select * from #t)
group by a.OwnerUserId 
having sum(a.Score) > @minScore
order by sum(a.Score) desc
) as X on X.OwnerUserId = u.Id
order by Score desc

Enter Parameters

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