Finding Unaccepted Questions To Answer

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

-- User parameters for finding questions. Here is
-- a brief description of what each parameter does.
  
  -- @MinQuestionVotes - The minimum amount of votes on a question.
  -- @MaxQuestionAnswers - The maximum amount of answers to a question.
  -- @QuestionTags - The tags that should be on the questions.

DECLARE @MinQuestionVotes INT = ##MinQuestionVotes:int?5##;
DECLARE @MaxQuestionAnswers INT = ##MaxQuestionAnswers:int?0##;
DECLARE @QuestionTags NVARCHAR(150) = ##QuestionTag1:string##;


-- SELECT the final results. Data is filtered based
-- on the following conditions.

  -- ClosedDate  IS EQUAL TO              null
  -- PostTypeId  IS EQUAL TO              question
  -- Score       GREATER THAN OR EQUAL TO @MinQuestionVotes
  -- AnswerCount LESS THAN OR EQUAL TO    @MaxQuestionAnswers
  -- Tags        CONTAIN                  @QuestionTags
SELECT
    Posts.Id AS [Post Link]
  , OwnerUserId AS [User Link]
  , Posts.Score
  , Posts.Tags
  , Posts.ViewCount
  , Posts.AnswerCount
  FROM Posts 
    INNER JOIN PostTags ON Posts.Id = PostTags.PostId
    INNER JOIN Tags ON PostTags.TagId = Tags.Id
  WHERE
    Posts.PostTypeId = 1 AND
    Posts.ClosedDate IS NULL AND
    Posts.Score >= @MinQuestionVotes AND
    Posts.AnswerCount <= @MaxQuestionAnswers AND
    Tags.TagName LIKE CONCAT('%', @QuestionTags, '%');

Enter Parameters

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