Questions I've answered and closed


Please login or register to vote for this query.

(click on this box to dismiss)

Questions that a user has both answered and successfully voted to close.

Stack Overflow

Q&A for professional and enthusiast programmers

select top 1000
  Question.Id as [Post Link],
  Question.CreationDate as [Asked],
  min(Answer.CreationDate) as [Answered],
  Question.ClosedDate as [Closed],
  (len(CloseEvent.Text) - len(replace(CloseEvent.Text,'"Id":',''))) / 5 as [Voters],
  Question.Score as [QScore],
  max(Answer.Score) as [AScore],
  (case when CloseEvent.Comment in ('1', '101') then 'dupe' else '' end) as [Dupe?]
from Posts as Question
join Posts as Answer on Answer.ParentId = Question.Id
join PostHistory as CloseEvent on CloseEvent.PostId = Question.Id 
where Answer.PostTypeId = 2
  and Answer.OwnerUserId = ##UserId##
  and CloseEvent.PostHistoryTypeId = 10
  and CloseEvent.CreationDate = Question.ClosedDate
  -- posthistory json hack from
  and CloseEvent.Text like '%"Id":'+cast(##UserId## as nvarchar)+',%'
group by Question.Id, Question.CreationDate, Question.ClosedDate, CloseEvent.Text, Question.Score, CloseEvent.Comment
order by Question.Id

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results