DECLARE @Minimum int = ##Minimum?20##; select AOwnerId [...

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

DECLARE @Minimum int = ##Minimum?20##;
-- Minimum: Minimum count:   "Returns all users with at least this many qualifying questions"

select AOwnerId [User Link], Count
from (select a.OwnerUserId AOwnerId,
             count(*) Count
        from Posts q 
             join Posts a on a.ParentId = q.Id
        where q.PostTypeId = 1 and 
              q.Score >= 1                                   
        group by a.OwnerUserId
        having count(*) >= @Minimum) AnswerQEditor
order by Count desc

Enter Parameters

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