select p.id as [Post Link], count(*) from posts p left j...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Show users who marked a as "favorites", and which posts they marked for all questions of a certain user

Stack Overflow

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

Enter Parameters

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