select top 20 userid, userid as [User Link], count(*) as ...

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

select top 20
  userid, userid as [User Link], count(*) as "total edits",
  sum(rej) as rejected, sum(app) as approved
from
  (select owneruserid as userid, 
          case when rejectiondate is null then 0 else 1 end as rej,
          case when approvaldate is null then 0 else 1 end as app
          from suggestededits) a
group by userid
order by rejected desc

Enter Parameters

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