Trend of [posts] tagged with [tag] that [do not] contain [search term] in body

0

Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts Meta

Q&A about the site for enthusiasts and power users of the Android operating system

declare @tagToSearch nvarchar(35) = ##tag:string##;
declare @textToSearch nvarchar(max) = ##text:string##;
declare @include bit = iif(##include:string?yes## = 'yes', 1, 0);

select
  datefromparts(
    datepart(year, CreationDate),
    datepart(month, CreationDate),
    1
  ) as Created,
  count(Id) as [Questions Posted]
from
  Posts
where
  PostTypeId = 1
  and
  charindex('<' + @tagToSearch + '>', Tags) > 0
  and
  (
    @include = 1 and charindex(@textToSearch, Body) > 0
    or
    @include = 0 and charindex(@textToSearch, Body) = 0
  )
group by
  datefromparts(
    datepart(year, CreationDate),
    datepart(month, CreationDate),
    1
  )
order by
  Created
asc

Enter Parameters

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