4

Following the question posted on linked page:

Filter questions by number of comments

I would like to search for those questions that have 0 answers, 0 comments, but also specific phrases - such as "Excel" and "VBA".

What would I need to add / change in that query in dataexplorer to do this?

1
  • 1
    Probably something as simple as adding a WHERE p.body like '%Excel%' OR p.title like '%Excel%', etc.
    – Rob Mod
    Mar 5, 2016 at 5:47

2 Answers 2

3

As indicated by Rob I forked the query to implement his suggestion:

-- Questions with no answers and no comments

declare @phrase nvarchar(200) = ##phrase:string##

select TOP 30
  p.Id as [Post Link]
  FROM Posts p
  WHERE 
  p.PostTypeId = 1 AND 
  p.score >= 0 AND
  p.closeddate is null AND
  ISNULL(p.AnswerCount,0) = 0 AND
  ISNULL(p.CommentCount,0) = 0 AND
  (p.body like '%' + @phrase +'%' 
  or p.title like '%' + @phrase + '%') 
  order by p.score desc
0

Ok thanks, my query is on page linked below:

https://data.stackexchange.com/stackoverflow/query/446466/no-comments-no-answers-and-title-or-body-contains-excel

You must log in to answer this question.

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