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

;
WITH CLOSEDQUESTIONS(Id, Score, AScore, VotesNeededToDelete)
AS (
SELECT
  p.Id AS [Post Link], p.Score, SUM(a.Score) AS AScore,
  CASE WHEN 3 + ((p.Score + Sum(a.Score)) /20)>10
  THEN 10
  ELSE 3 + ((p.Score + Sum(a.Score)) /20)
  END as VotesNeededToDelete
FROM Posts as p
INNER JOIN Posts as a ON a.ParentID = p.Id
WHERE p.PostTypeId=1 AND p.ClosedDate IS NOT NULL
GROUP BY p.Id, p.Score
)
SELECT TOP 10 * FROM CLOSEDQUESTIONS

Enter Parameters

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