Question 1

0

Please login or register to vote for this query.

(click on this box to dismiss)

Earth Science

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;

Enter Parameters

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