post count with ##Tag## and containing ##Word## in the title

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

SELECT TitleCount.titleCount, TagCount.tagCount
  FROM 
  (SELECT COUNT(Posts.Id) AS titleCount FROM Posts
   JOIN PostTags ON
       PostTags.PostId = Posts.Id
   JOIN Tags ON
       PostTags.TagId = Tags.Id
  WHERE Tags.TagName LIKE ##Tag:string##
  AND Posts.Title LIKE '%'+##Word:string##+'%') AS TitleCount,
  (SELECT COUNT(Posts.Id) AS tagCount FROM Posts
   JOIN PostTags ON
       PostTags.PostId = Posts.Id
   JOIN Tags ON
       PostTags.TagId = Tags.Id
  WHERE Tags.TagName LIKE ##Tag:string##) AS TagCount

Enter Parameters

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