Show users who marked my posts as "favorites", and which posts they marked...
Q&A for professional and enthusiast programmers
-- Who Favorited Me? -- Show users who marked my posts as "favorites", and which posts they marked... DECLARE @UserId int = ##UserId## SELECT v.userid AS [User Link], t.Name, p.id AS [Post Link] FROM posts p, votetypes t, votes v join posts ON posts.id=v.postid WHERE p.owneruserid=@UserID AND v.votetypeid=t.Id