Most Favorite'd Posts (for specified tag)

0

Please login or register to vote for this query.

(click on this box to dismiss)

Lists accepted answers for the questions that are the most 'favorited' for the specified tag. (Group by 100's of fav's, when sorting.)

Japanese Language

Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language

select 
  case when min(p.acceptedanswerid) is null then postid else min(p.acceptedanswerid) end as [Post Link],
  format(count(*),'#,##0') [# Fav's],
  format(score,'#,##0') Score,
  format(datediff(month,min(p.creationdate),getdate())/12.0,'#,##0.0') [Years Old]  
from votes v left join posts p on v.postid=p.id
where votetypeid=5   --favorites = 5
  and p.posttypeid=1
  and p.tags like '%<' + ##tag:string?php## + '>%'
group by postid, p.title, score
having count(*) > ##minfav:int?100## 
order by (round(count(*)/100,0)*100.0)+(score/10000.0) desc 

-- tag: Enter a single, complete tag:
-- minfav: Minimum # of favorite's:

Enter Parameters

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