What's my rank compared to people who signed up when I did.

0

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフローMeta

プログラマーと熱狂的なプログラマーのためのサイトに関する質問と回答

DECLARE @startDate AS DATETIME2
DECLARE @reputation AS INT

SELECT
  @startDate = CreationDate,
  @reputation = Reputation
FROM
  Users
WHERE
  Id = '##UserId##'
  
SELECT
    COUNT(*)          AS [Total Users]
FROM
    Users
WHERE
        CreationDate  > @startDate
    AND Reputation    > 200

SELECT
  COUNT(*) + 1         AS [My Rank]
FROM
    Users
WHERE
        CreationDate  > @startDate
    AND Reputation    > @reputation

SELECT
    DisplayName,
    Reputation,
    CreationDate
FROM
    Users
WHERE
        CreationDate  > @startDate
    AND Reputation    > @reputation
ORDER BY 
    Reputation        DESC
    
SELECT
    DisplayName,
    Reputation,
    CreationDate
FROM
    Users
WHERE
        CreationDate  > @startDate
    AND Reputation    > @reputation
ORDER BY 
    CreationDate      DESC

Enter Parameters

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