select count(*) from posts p join users u on p.owneruseri...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select count(*)
from posts p
join users u on p.owneruserid = u.id
join (select p2.owneruserid, count(*) as count from posts p2 group by p2.owneruserid) b
  on b.owneruserid = u.id
where posttypeid = 1
  and acceptedanswerid is null
  and u.lastaccessdate < '2012-10-06'
  and (answercount is null or answercount > 0)
  and b.count < 2

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached