User List: Tenure

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physical Fitness Meta

Q&A about the site for physical fitness professionals, athletes, trainers, and those providing health-related needs

SELECT TOP ##MaxList##
  ROW_NUMBER() OVER(ORDER BY CreationDate ASC) AS [#],
  --ROW_NUMBER() OVER(ORDER BY Id ASC) AS [#],  -- same as ordering by CreationDate
  --ROW_NUMBER() OVER(ORDER BY Duration DESC) AS [#],
  Id, Id AS [User Link], Age, Reputation, CreationDate, LastAccessDate, Tenure AS [Days]

FROM (
    SELECT *,
       CONVERT(int, LastAccessDate - CreationDate) as Tenure
    FROM Users
      
     ) AS UsersAugmented

WHERE Id <= ##MaxList##

-- Possible temporary reorder
--ORDER BY Reputation DESC
--ORDER BY LastAccessDate DESC, Tenure DESC
--ORDER BY Tenure DESC, LastAccessDate DESC

Enter Parameters

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