(only users with at least 10 Popular Questions)
Q&A for professional and enthusiast programmers
-- Users by Popular Question ratio -- (only users with at least 10 Popular Questions) select * from ( select top 20 * from ( select Users.Id as [User Link], Q.QuestionCount ,Q2.QuestionCount2 from Users inner join ( select OwnerUserId, count(Id) as QuestionCount from posts where PostTypeId = 1 group by OwnerUserId ) as Q on Users.Id = Q.OwnerUserId inner join ( select OwnerUserId, count(Id) as QuestionCount2 from posts where PostTypeId = 2 group by OwnerUserId ) as Q2 on Users.Id = Q2.OwnerUserId and Users.Id = Q.OwnerUserId ) f order by f.[QuestionCount] desc ,f.[QuestionCount2]desc ) k order by k.QuestionCount+k.[QuestionCount2]desc