Get favorites for a given Question

0

Please login or register to vote for this query.

(click on this box to dismiss)

Grabs the favoriting information on a given question

Stack Overflow

Q&A for professional and enthusiast programmers

-- getFavoritesForGivenQuestion.sql
/* helper that gets the favorites on a given question */

/* question information */
DECLARE @questionID int = ##questionID##;

SELECT * FROM Votes
WHERE VoteTypeId = 5 /* for favorites */
AND PostId = @questionID; /* on given question */

Enter Parameters

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