Q&A about the site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation
-- Top users per tag declare @tag_id int = (select id from tags where tagname = LOWER('##TagName##')); select top (##Limit##) rank() over (order by sum(answers.score) desc) "Rank", users.id "User Link" ,sum(answers.score) as "Score" from users join posts answers on (users.id = answers.owneruserid) join posts parent on (answers.parentid = parent.id) join posttags on (parent.id = posttags.postid) where posttags.tagid = @tag_id and LOWER(Location) LIKE LOWER('%##Location##%') --and answers.posttypeid = 2 -- answers only group by users.id order by sum(answers.score) desc;