Show users who marked a as "favorites", and which posts they marked
for all questions of a certain user
Q&A for professional and enthusiast programmers
-- Who Favorited My Question?
-- Show users who marked a as "favorites", and which posts they marked...
select p.id as [Post Link], count(*)
from posts p
left join votes uv on p.id = uv.postid
left join votes dv on p.id = dv.postid
where uv.votetypeid = 2
and dv.votetypeid = 3
and p.OwnerUserId = ##UserId##
group by p.id