Most Upvotes for CSS in a given Location

0

Please login or register to vote for this query.

(click on this box to dismiss)

Wanted to know who the serious players are in my city for various tags. Should turn TagName into an Input as well...

Network Engineering

Q&A for network engineers

DECLARE @City nvarchar(100) = '%##CityName##%';
SELECT
    DisplayName, Reputation, Age, WebsiteUrl,
    COUNT(*) AS UpVotes 
FROM Tags
    INNER JOIN PostTags ON PostTags.TagId = Tags.id
    INNER JOIN Posts ON Posts.ParentId = PostTags.PostId
    INNER JOIN Votes ON Votes.PostId = Posts.Id and VoteTypeId = 2
    INNER JOIN Users ON Posts.OwnerUserId = Users.Id
WHERE 
    Lower(Location) LIKE LOWER(@City)
GROUP BY DisplayName, Reputation, UpVotes, Age, WebsiteUrl
ORDER BY UpVotes DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results