Find the users who have marked my questions as favorites.
Q&A for professional and enthusiast programmers
-- Fan Finder
-- Enter Query Description
declare @UserId int = ##UserId##
select top 200 v.UserId as [User Link], count(*) Total
from Votes v
join Posts p on p.id = v.PostId
where p.OwnerUserId = @UserId
and v.VoteTypeId = 5
group by v.UserId
order by Total desc
--select top 20 votetypeid
--where rtrim(userid) != ''
--group by votetypeid