Please login or register to vote for this query.

(click on this box to dismiss)

select * from Users u join (select top 10 a.OwnerUserId as Id, count(a.OwnerUserId) as TrueAnswer from (select * from Posts where PostTypeId=2) a join (select * from Posts where PostTypeId=1) q on a.Id=q.AcceptedAnswerId group by a.OwnerUserId order by TrueAnswer desc) s on u.Id=s.Id order by s.TrueAnswer desc;

Motor Vehicle Maintenance and Repair Meta

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

select top 1000000 *into #LPosts from Posts;

with tmp(Id, WinRate, TrueAnswer, Answer) as(
select tmp1.Id as Id, (cast(tmp1.TrueAnswer as float)/tmp2.Answer * 100) as WinRate, tmp1.TrueAnswer as TrueAnswer, tmp2.Answer as Answer from
(select abc.OwnerUserId as Id, count(abc.OwnerUserId) as TrueAnswer from 
(select * from #LPosts where PostTypeId=2) abc 
inner join
(select * from #LPosts where PostTypeId=1) zxc on abc.Id=zxc.AcceptedAnswerId
group by abc.OwnerUserId) tmp1
inner join
(select OwnerUserId as Id, count(OwnerUserId) as Answer from  #LPosts
where PostTypeId=2
group by OwnerUserId
having count(OwnerUserId)>20) tmp2 on tmp1.Id=tmp2.Id)

select * from Users u 
inner join
(select *from tmp where WinRate=(select MAX(WinRate) from 
tmp))tmp on u.Id=tmp.Id;

Enter Parameters

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