Q&A for professional and enthusiast programmers
DECLARE @MinRep int = ##MinRep## DECLARE @MinDownVotes int = ##MinDownVotes## DECLARE @UserId int = ##UserId## SELECT Id as [User Link], Id, UpVotes, DownVotes, Reputation, ROUND(1000*CAST(DownVotes AS float) / CAST(Reputation AS float), 3) AS DownToRepPermil FROM Users WHERE Id=@UserId OR (Reputation > @MinRep AND DownVotes > @MinDownVotes) ORDER BY DownToRepPermil ASC