Top voters

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow en español

Preguntas y respuestas para programadores y profesionales de la informática

-- Top voters - they vote

select top 500
  *
from (
select --top 500 
  [Id] as [User Link],
  --[DisplayName],
  DATEDIFF(DAY, [LastAccessDate], GETDATE()) as [Seen],
  [Reputation],
  [UpVotes],
  [DownVotes],
  ([UpVotes] + [DownVotes]) as [Votes cast],
  (select COUNT(*) from posts where PostTypeId = 1 and OwnerUserId = u.Id) as [Questions],
  (select COUNT(*) from posts where PostTypeId = 2 and OwnerUserId = u.Id) as [Answers],  
  ROUND(((CAST([UpVotes] as float) / CAST([Reputation] as float)) * 100), 2) as [UV/Rep],
  ROUND(((CAST([DownVotes] as float) / CAST([Reputation] as float)) * 100), 2) as [DV/Rep],
  ROUND(((CAST(([UpVotes] + [DownVotes]) as float) / CAST([Reputation] as float)) * 100), 2) as [V/Rep]
  from Users u
where 
  [UpVotes] + [DownVotes] > 500 and
  [Reputation] > 1
  --[Id] = ##UserId##
--order by [Reputation] desc
) as x
where [Seen] < 90 and [V/Rep] >= 8
order by [Reputation] desc

Enter Parameters

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