The minimum of {edits, downvotes} for selected users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with editCount as (
  select count(e.Id) as editN, u.Id as usr from Users u
  inner join PostHistory e on e.UserId = u.Id
  where u.Id in (##list##)
  and e.PostHistoryTypeId = 5 -- body edits only 
  and e.PostId not in (select Id from Posts where OwnerUserId = u.Id) -- others
  group by u.Id)  
  select top 100 u.Id as [User Link], editN as Edits, Downvotes, (editN+DownVotes)/2-abs(editN-DownVotes)/2 as EDmin from Users u 
inner join editCount on editCount.usr = u.Id
order by EDmin desc

Enter Parameters

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