Self-answered questions

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

-- Inspired by https://data.stackexchange.com/stackoverflow/query/1612188/self-answered-questions

SELECT q.Id AS [Post Link], q.Score AS 'Question score',
  MAX(a.Score) AS 'Max. answer score', q.CreationDate,
  Count(*) AS 'Self-answers'
  FROM Posts AS q
  INNER JOIN Posts AS a
    ON a.ParentId = q.Id AND q.owneruserid = a.owneruserid
  GROUP BY q.Id, q.Score, q.CreationDate
  ORDER BY "Self-answers" DESC

Enter Parameters

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