Most viewed questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Date format YYYY-MM-DD example 2023-06-01 Use TagName = N/A to see all posts

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT TOP 100
Questions.ViewCount,
Questions.Id AS [Post Link],
Questions.Score,
Questions.AnswerCount,
Questions.AcceptedAnswerId

FROM Posts AS Answers 
    INNER JOIN Posts AS Questions 
    ON Questions.Id = Answers.ParentId
    
    INNER JOIN PostTags 
    ON PostTags.PostId = Answers.ParentId
    
    INNER JOIN Tags
    ON Tags.Id = PostTags.TagId
 
WHERE
  (lower('##TagName##') = 'n/a' or Tags.TagName = Lower('##TagName##'))
  and Questions.CreationDate between '##BeginDate##' and '##EndDate##'

GROUP BY
  Questions.Id, 
  Questions.Score,
  Questions.ViewCount,
  Questions.AnswerCount,
  Questions.AcceptedAnswerId

ORDER BY 
  ViewCount DESC

Enter Parameters

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