Unsung heroes with exactly 10 zero score accepted answers

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select u.Id
from
  Users u
  join Badges b on u.Id = b.UserId
  join (Posts q inner join Posts a on a.Id = q.AcceptedAnswerId) on u.Id = a.OwnerUserId
where b.Name = 'Unsung Hero'
  and q.OwnerUserId != a.OwnerUserId
  and a.PostTypeId = 2
  and b.Date > a.CreationDate
  group by (u.Id)
  having sum(case when a.Score = 0 then 1 else 0 end) = 10

Enter Parameters

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