Newest Unanswered Questions with a single tag

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

declare @tagName varchar(25) = ##TagName:string##

select top 50 SingleTagQs.Id as [Post Link]
  from ((select Posts.Id, count(PostTags.TagId) as TagCount
    from Posts join PostTags on Posts.Id = PostTags.PostId
    group by Posts.Id
    having count(PostTags.TagId) = 1) as SingleTagQs
      join PostTags on SingleTagQs.Id = PostTags.PostId)
        join Tags on PostTags.TagId = Tags.Id
  where Tags.TagName = @tagName

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results