Trend of questions tagged with [tag] that are also [not] tagged with [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 @tag1 nvarchar(35) = '<' + ##Tag1:string## + '>';
declare @tag2 nvarchar(35) = '<' + ##Tag2: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(@tag1, Tags) > 0
  and
  (
    @include = 1 and charindex(@tag2, Tags) > 0
    or
    @include = 0 and charindex(@tag2, Tags) = 0
  )
group by
  datefromparts(
    datepart(year, CreationDate),
    datepart(month, CreationDate),
    1
  )
order by
  Created
asc

Enter Parameters

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