Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences
-- Calculate date 5 years ago DECLARE @FiveYearsAgo DATETIME = DATEADD(YEAR, -5, GETDATE()); SELECT TOP 10 OwnerUserId AS UserId, COUNT(*) AS PostCount FROM Posts WHERE CreationDate >= @FiveYearsAgo GROUP BY OwnerUserId ORDER BY PostCount DESC;