Questions by Tags

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

-- List activity by tags

-- tags: List of tags "Comma separated list of tags to query"

declare @tags varchar(max) = ##tags:string##;

select distinct
  p.Id PostId,
  p.Title,
  replace(replace(replace(p.Tags, '><', ','), '<', ''), '>', '') Tags,
  p.CreationDate,
  p.Score,
  p.ViewCount,
  p.AnswerCount,
  p.CommentCount,
  p.FavoriteCount,
  case
    when p.AcceptedAnswerId is null then 0
    else 1
  end IsAnswerAccepted,
  a.CreationDate AnsweredDate
from string_split(@tags, ',') s
inner join Tags t on s.value = t.TagName
inner join PostTags pt on t.Id = pt.TagId
inner join Posts p on pt.PostId = p.Id
left join Posts a on p.AcceptedAnswerId = a.Id
order by p.Id
;

Enter Parameters

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