Top User in a tag over a period of time

0

Please login or register to vote for this query.

(click on this box to dismiss)

Role-playing Games Meta

Q&A about the site for gamemasters and players of tabletop, paper-and-pencil role-playing games

select top 30
       p.owneruserid as [User Link]
       , count(distinct p.id) [# Answers]
       , sum(case votetypeid 
             when 2 then 1 
             when 3 then -1
             end) [score]
       , sum(case votetypeid 
             when 2 then 10 
             when 3 then -2
             end) [ reputation]
from posts p
inner join posttags pt on pt.postid = p.parentid
inner join tags t on t.id = pt.tagid
inner join votes v on v.postid = p.id
where t.tagname = ##tagname:string?pandas##
and v.votetypeid in (2,3)
and p.creationdate between ##start:string?2019-01-01## and ##end:string?2019-12-31##
and v.creationdate <= ##end:string?2019-12-31##
group by p.owneruserid
order by sum(case votetypeid 
             when 2 then 10 
             when 3 then -2
             end) desc

Enter Parameters

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