rob ashton js framework blog post query

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

DECLARE @TagName  varchar(128) = 'angularjs'
DECLARE @TagName2 varchar(128) = 'angular'
DECLARE @TagName3 varchar(128) = 'angular.js'

    SELECT COUNT(*) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName
      )
    ) 
    
    SELECT COUNT(*) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName2
      )
    ) 
    
    SELECT COUNT(*) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName3
      )
    ) 
    
   ---    AND P.ClosedDate is not null
    --AND P.OwnerDisplayName is  null 
   -- AND P.CommunityOwnedDate IS NULL 
    --AND P.PostTypeId = 1 
    --and P.OwnerUserId > 0

Enter Parameters

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