Posts tagged with tag that contain the tag as title prefix

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 @tag nvarchar(35) = ##tag:string##
declare @numAnswers int = iif(
  lower(##answers:string?any##) = 'any', 
  -1,
  cast(##answers## as int)
)

select
  Id as [Post Link],
  Tags,
  Score,
  AnswerCount as Answers
from
  Posts
where
  charindex(@tag,Tags) > 0
  and
  lower(Title) like replace(@tag,'-',' ') + '%'
  and
  ClosedDate is null
  and
  AnswerCount = iif(@numAnswers = -1, AnswerCount, @numAnswers)
order by
  Score
desc

Enter Parameters

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