Tags that are used together - Manual edition

0

Please login or register to vote for this query.

(click on this box to dismiss)

This might give some interesting insight in the types of tags used together..

Moderators

Q&A for community managers, administrators, and moderators

DECLARE @total float
SELECT @total = Sum(Cast(ViewCount as bigint)) FROM Posts WHERE PostTypeId = 1

DECLARE @TagName nvarchar(255)

DECLARE MY_CURSOR CURSOR 
  LOCAL STATIC READ_ONLY FORWARD_ONLY
FOR 
SELECT TOp 100
    Tags.Tagname
  FROM Posts 
  JOIN PostTags ON Posts.Id = PostTags.PostId
  JOIN Tags ON PostTags.TagId = Tags.Id
  WHERE Posts.PostTypeId = 1 
  GROUP BY Tags.Tagname
  ORDER BY Sum(Cast(Posts.ViewCount as bigint)) DESC

OPEN MY_CURSOR
FETCH NEXT FROM MY_CURSOR INTO @TagName
WHILE @@FETCH_STATUS = 0
BEGIN 
    PRINT @TagName
    FETCH NEXT FROM MY_CURSOR INTO @TagName
END
CLOSE MY_CURSOR
DEALLOCATE MY_CURSOR

Enter Parameters

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