SELECT p.id AS [Post Link], COUNT(*) AS Favorites FROM vo...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT p.id AS [Post Link], COUNT(*) AS Favorites
  FROM votes AS v
  INNER JOIN posts AS p ON v.postid = p.id
  INNER JOIN posttags AS pt ON p.id = pt.postid
  INNER JOIN tags AS t ON t.id = pt.tagid
  WHERE v.votetypeid = 5 -- Marked as favorite
    AND t.tagname = lower(##TagName:string##)
  GROUP BY p.id
  HAVING COUNT(*) >= ##NumberOfFavorites:int## 
  ORDER BY COUNT(*)

Enter Parameters

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