Users with specific numbers of questions / answers

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

select userid
      , sum(q) 
      , sum(a)
from
(
select owneruserid as userid
     , count(*) q
     , 0 a
from posts
where posttypeid = 1
and owneruserid is not null
group by owneruserid
having count(*) < ##q##
union
select owneruserid as [User Link]
     , 0 
     , count(*) a
from posts
where posttypeid = 2
and owneruserid is not null
group by owneruserid
having count(*) > ##a##
) as data
group by userid
having sum(q) < ##q## and sum(a) > ##a##

Enter Parameters

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