with editors as ( select userid, userid as [User Link], c...

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 editors as (
select 
  userid, userid as [User Link], count(*) as "total edits",
  sum(rej) as rejected, sum(app) as approved,
  sum(app) * 100 / count(*) as "percentage 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
),

thing as (
select top 20 *
from editors
order by userid
)

select *,
  row_number() over(order by "total edits" asc)
from thing

Enter Parameters

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