What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

I'm trying to query the great Data Explorer tool to ask all kinds of questions about unanswered questions on Stack Overflow.

The problem is that there's a vast inconsistency between the results I get in my queries and the results that Stack Overflow publishes on the main site.

Specifically, Stack Overflow declares that there are

651,080 questions with no answers

(source)

However when I run this simple query which should give me the same result on Stack Overflow's DB -

select count(*) from posts where posttypeid = 1 and answercount = 0

I get this result -

56873

Unless I've written the wrong query for what I would like to know, this number is far off what Stack Overflow's officially declare (for the better).

Can anyone please help me understand why I get this inconsistency?

Thanks!

share|improve this question

2 Answers 2

up vote 4 down vote accepted
  1. A post with no answers that have a score of 1 or more or an accepted answer is considered "unanswered". In other words, a zero, or negatively scored answer doesn't mean the question is "answered".
  2. Closed questions are not "unanswered".
  3. The data explorer isn't entirely up to date, it'll always be a bit out of date (by a matter of days, generally), so even if you fix you're query, it'll only ever be "close".
share|improve this answer

The reasons given by Servy are valid, but they can't explain the disparity between 651,080 and 56,873. The real reason is that the questions that never had an answer have AnswerCount set to NULL, not to 0. The questions with AnswerCount = 0 are those that had an answer once, but not anymore (any answer[s] have been deleted). To pick both kinds, you can use ISNULL:

WHERE ISNULL(AnswerCount,0) = 0

As a side effect, you now know how to locate questions with deleted answers (even though you can't see those deleted answers).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .