Top Tag Answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

History

Q&A for historians and history buffs

SELECT
    DATEPART(year, CreationDate) AS TimeRange,
    COUNT(Id) AS User_Number,
    SUM(case when Reputation > 1000 Then 1 else 0 end) AS Rep1000,
    SUM(case when Reputation > 1500 Then 1 else 0 end) AS Rep1500,
    SUM(case when Reputation > 2000 Then 1 else 0 end) AS Rep2000,
    SUM(case when Reputation > 2500 Then 1 else 0 end) AS Rep2500,
    SUM(case when Reputation > 3000 Then 1 else 0 end) AS Rep3000
FROM
    Users
WHERE
  Reputation > 1 AND
  CreationDate BETWEEN '2011-01-01 00:00:00'
    AND '2018-12-31 23:59:59'
    GROUP BY DATEPART(year, CreationDate)

Enter Parameters

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