with accepted as ( select top 20 owneruserid as userid, 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 accepted as (
select top 20 owneruserid as userid, 
  count(*) as 'approved'
from suggestededits
where approvaldate is not null
group by owneruserid
order by approved desc),

rejected as (
select top 20 owneruserid as userid, 
  count(*) as 'rejected'
from suggestededits
where rejectiondate is not null
group by owneruserid
order by rejected desc)

select a.userid as [User Link], approved, rejected 
from accepted a
full outer join rejected r
on a.userid = r.userid

Enter Parameters

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