Newer users with higher rep

0

Please login or register to vote for this query.

(click on this box to dismiss)

List users that have been members shorter, but have higher rep than this user. The last Entry will be this user, for comparison

Artificial Intelligence

Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment

-- Newer users with higher rep
-- List users that have been members shorter, but have higher rep than this user.

DECLARE @UserId int = ##UserId##

SELECT 
    u.id as [User Link],
    cast(datediff(day, u.creationDate, current_timestamp) as nvarchar) + ' Days'
      as [Member for],
    u.reputation as [Rep],
    u.reputation - you.reputation as [Rep more than yours],
    (u.reputation / datediff(day, u.creationDate, current_timestamp)) as [Avg rep per Day]
FROM 
    Users u, Users you
WHERE 
    you.Id = @UserId
AND u.creationdate >= you.creationdate
AND
    u.reputation >= you.reputation
ORDER BY 
    u.creationdate DESC

Enter Parameters

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