My Favourites Count

2

Please login or register to vote for this query.

(click on this box to dismiss)

Count of favorites that user has created on Stackoverflow. Enter the stackoverflow userid to see that users favorites count...

Stack Overflow

Q&A for professional and enthusiast programmers

declare @userid int;
set @userid = ##UserId##

SELECT count(*) as [Favorites Count]

FROM Votes, Posts

WHERE
     (Votes.PostId=Posts.Id) AND
     (Votes.VoteTypeId = 5) AND
     (Votes.UserId=@userid)
     
Select DisplayName, Id
from Users 
where Id = @userid

Enter Parameters

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