Posts with a Specific Tag and a Minimum Number of Favorites

1

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 P.Id AS [Post Link], P.FavoriteCount
FROM Votes V, Posts P, PostTypes Pt, VoteTypes Vt
WHERE P.Id = V.PostId
AND P.PostTypeId = Pt.Id
AND V.VoteTypeId = Vt.Id
AND Pt.Id = 1
AND Vt.Id = 5
AND P.Score > 0
AND P.DeletionDate IS NULL
AND P.CommunityOwnedDate IS NULL
AND P.OwnerUserId IS NOT NULL
AND P.AnswerCount IS NOT NULL
AND P.ClosedDate IS NULL
AND P.CommentCount IS NOT NULL
AND P.FavoriteCount >= ##min##
AND P.Tags LIKE '%##tag##%'
AND (SELECT Count(V2.PostId) FROM VOTES V2 WHERE V.VoteTypeId = 5 AND V2.PostId = P.Id) >= ##min## 
GROUP BY P.Id, P.FavoriteCount

Enter Parameters

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