First_part

0

Please login or register to vote for this query.

(click on this box to dismiss)

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

-- Enter Query Title
-- Enter Query Description

select *
from (
select top(100000) t1.OwnerUserId, dense_rank() over(order by (1.0 * t1.AcceptedAnswerPosts)/t1.AnswerPosts desc) as rank
from
(select t2.OwnerUserId, count(t2.AnswerId) as AnswerPosts, count(t1.AcceptedAnswerId) as AcceptedAnswerPosts
from (select top(100000) Id as QuestionId, AcceptedAnswerId
from Posts
where PostTypeId = 1) as t1 right join
(select top(100000) Id as AnswerId, OwnerUserId
from Posts
where PostTypeId = 2) as t2 on t1.AcceptedAnswerId = t2.AnswerId
group by t2.OwnerUserId
having count(t2.AnswerId) > 20) as t1) as t1
where rank = 1;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results