SET NOCOUNT ON DECLARE @UserId INT SELECT @UserId = 213...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Italian Language Meta

Q&A about the site for students, teachers, and linguists wanting to discuss the finer points of the Italian language

-- Enter Query Title
-- Enter Query Description

SET NOCOUNT ON

DECLARE @UserId INT
SELECT @UserId = 213474

DECLARE @TotalCount FLOAT
SELECT @TotalCount = COUNT(*) FROM Users

SELECT
  u.DisplayName AS Name,
  u.Reputation,
  (SELECT COUNT(*) FROM Users u2 WHERE u2.Reputation >= u.Reputation) AS Rank,
  @TotalCount AS TotalUsers,
  ROUND((CAST((SELECT COUNT(*) FROM Users u2 WHERE u2.Reputation >= u.Reputation) AS FLOAT) / @TotalCount) * 100, 2) AS Percentile
FROM Users u
WHERE u.Id = @UserId

Enter Parameters

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