WITH PPosts AS ( SELECT Posts.ID, Posts.PostTypeId, Pos...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Anime and Manga

Q&A for anime and manga fans

WITH PPosts AS
(
SELECT   Posts.ID, Posts.PostTypeId, Posts.CreationDate, Posts.Score, Posts.ViewCount, Posts.OwnerUserId, Posts.LastActivityDate,Posts.AnswerCount, Posts.CommentCount, Posts.FavoriteCount FROM Posts
WHERE (Posts.CreationDate between '2012-03-01 10:00' and '2012-03-01 10:01')
), 
Tagi AS(
SELECT Posts.ID, Posts.PostTypeId, Posts.CreationDate, Posts.Score, Posts.ViewCount, Posts.OwnerUserId, Posts.LastActivityDate, Posts.AnswerCount, Posts.CommentCount, Posts.FavoriteCount, Tags.id AS TagId
FROM Posts, tags
where tags.id in (select top 1 posttags.tagid from posttags join tags on posttags.tagid = tags.id
where PostTags.postid = Posts.id
order by tags.count desc)
)
select tagi.ID, tagi.PostTypeId, tagi.CreationDate, tagi.Score, tagi.ViewCount, tagi.OwnerUserId, tagi.LastActivityDate, tagi.AnswerCount, tagi.CommentCount, tagi.FavoriteCount, tagi.TagId 
from PPosts left join tagi on PPosts.id=tagi.id

Enter Parameters

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