This query is being used to decide the criteria for a proposed gold version of the revival/necromancer badge, by seeing how many people would qualify for it based on different criteria.
Q&A for SharePoint enthusiasts
-- Gold revival/necromancer badge? -- This query is being used to decide the criteria for a proposed gold version of the revival/necromancer badge, by seeing how many people would qualify for it based on different criteria. DECLARE @DaysBetween int = ##DaysBetween## DECLARE @MinScore int = ##MinScore## SELECT u.DisplayName AS Username, COUNT(*) AS TimesAwarded FROM Posts AS q JOIN Posts AS a ON a.ParentId = q.Id JOIN Users AS u ON a.OwnerUserId = u.Id WHERE DATEDIFF(day, q.CreationDate, a.CreationDate) >= @DaysBetween AND a.PostTypeId = 2 AND a.Score >= @MinScore GROUP BY u.DisplayName ORDER BY TimesAwarded DESC, Username ;