How popular am I?

0

Please login or register to vote for this query.

(click on this box to dismiss)

Number of views divided by reputation. WORK IN PROGRESS. I'M LEARNING SQL HERE

Moderators

Q&A for community managers, administrators, and moderators

declare @UserId int = ##UserId##
-- declare @NTop int = 'Minimum Popularity'

--declare @Popularity decimal
--set @Popularity = convert(decimal(10,2),
--    convert(decimal(10,2), Views) /
--    convert(decimal(10,2), Reputation))

select
  Name = DisplayName,
  "User ID" = Id,
  Views = Views,
  Reputation = Reputation,
  Popularity = convert(decimal(10,4),
    convert(decimal(10,4), Views) /
    convert(decimal(10,4), Reputation))
from Users
where
  Id = @UserId
  and Reputation > 101
order by Popularity desc

Enter Parameters

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