Possible serial downvotes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Engineering

Q&A for professionals and students of engineering

WITH downvotes AS
(
SELECT
  post.ownerUserID as victim,
  post.id as post,
  vote.creationDate as date,
  count(vote.id) as number
FROM 
    posts as post
  inner join 
    votes as vote
   on
    vote.postID = post.id
    and datediff(day,post.creationdate,vote.creationdate) > ##daysSinceQuestionCreation##
WHERE
  vote.voteTypeID = 3 -- downvote
  AND post.ownerUserID is not null
GROUP BY
  post.ownerUserID,
  post.id,
  vote.creationDate
)

select 
  victim as [User Link], 
  date,
  count(post) as 'distinct posts', 
  sum(number) as 'total downvotes'
from downvotes
group by victim, date
having count(post) > 1
order by 'distinct posts' desc

Enter Parameters

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