List of top 100 questions having delete votes which are not yet deleted by votes remaining

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

SELECT TOP 10 p.Id As [Post Link], 
  Count(v.VoteTypeId) As DeleteVotes,
  p.Score + Sum(a.Score) as Scores,
  CASE WHEN 3 + ((p.Score + Sum(a.Score)) /20)>10
  THEN 10
  ELSE 3 + ((p.Score + Sum(a.Score)) /20)
  END as VotesNeededToDelete,
  CASE WHEN 3 + ((p.Score + Sum(a.Score)) /20)>10
  THEN 10
  ELSE 3 + ((p.Score + Sum(a.Score)) /20)
  END - Count(v.VoteTypeId) AS VotesRemaining
FROM Votes AS v
INNER JOIN Posts AS p ON v.PostId=p.Id
INNER JOIN Posts as a on a.ParentId = p.id
WHERE v.VoteTypeId=10
GROUP BY p.Id, p.Score
HAVING Count(v.VoteTypeId)>0
--ORDER BY DeleteVotes DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results