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) / 50) AS Top005,
    SUM(case when Reputation > 500 Then 1 else 0 end) AS Rep500,
    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,
    SUM(case when Reputation > 3500 Then 1 else 0 end) AS Rep3500,
    SUM(case when Reputation > 4000 Then 1 else 0 end) AS Rep4000,
    SUM(case when Reputation > 4500 Then 1 else 0 end) AS Rep4500,
    SUM(case when Reputation > 5000 Then 1 else 0 end) AS Rep5000
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