Find the users who have marked my questions as favorites.
Q&A for professional and enthusiast programmers
-- Fan Finder
-- Find the users who have marked my questions as favorites.
declare @UserId int = 3094533 --##UserId##
select top 200 q.OwnerUserId as [User Link], q.id As [Post Link], count(*) OVER(PARTITION by q.OwnerUserId) as FavoriteCount
from Posts q
join Posts p on p.ParentId = q.id
where p.OwnerUserId = @UserId
and q.OwnerUserId IS NOT NULL
order by FavoriteCount desc