Q&A for professional and enthusiast programmers
DECLARE @MinRep DATETIME = convert(int, '##MinimumRep?500##') DECLARE @MinPostCount DATETIME = convert(int, '##MinPostCount?5##') DECLARE @MaxVotes DATETIME = convert(int, '##MaxVotes?0##') SELECT users.id AS [User Link], reputation, upvotes + downvotes AS Votes, count(Posts.id) AS [Posts count] FROM users INNER JOIN Posts ON users.id = Posts.owneruserid WHERE upvotes + downvotes <= @MaxVotes AND reputation >= @MinRep GROUP BY users.id, reputation, upvotes, downvotes HAVING count(Posts.id) >= @MinPostCount ORDER BY reputation DESC