Posts with Favorites and 4 Delete Votes this Month

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 V.PostId, P.OwnerUserId as [User Link], P.Title, P.Body
FROM VOTES V, Posts P
WHERE V.VoteTypeId = 10
AND DATEDIFF(month, V.CreationDate, GETDATE() ) < 1
AND P.Id = V.PostId
AND P.FavoriteCount is not NULL
AND (SELECT Count(V2.PostId) FROM VOTES V2 WHERE V.VoteTypeId = 10 AND V2.PostId = P.Id) = 4 
GROUP BY V.PostId, P.OwnerUserId, P.Title, P.Body

Enter Parameters

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