Top Users by location and tag

0

Please login or register to vote for this query.

(click on this box to dismiss)

Created by samliew (http://stackoverflow.com/users/584192/samuel-liew)

Quantum Computing

Q&A for engineers, scientists, programmers, and computing professionals interested in quantum computing

-- Top Users by location and tag
-- Created by samliew (http://stackoverflow.com/users/584192/samuel-liew)
-- Modified by sgryzko 

SELECT
TOP 100 
    u.Id AS [User Link],
    count(p.id) AS [Tag Posts],
    sum(p.score) AS [Tag Reputation],
    u.Reputation AS [Total Reputation]
FROM
    Users u
inner join posts p on p.ownerUserid = u.id
inner join posttags pt on pt.postid = p.id
inner join tags t on t.id = pt.tagid
WHERE
    LOWER(Location) LIKE LOWER('%##location##%')
    and t.tagname='##tagname##'
group by u.reputation, u.id
ORDER BY
    sum(p.score) DESC;

Enter Parameters

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