Q&A for scientists using computers to solve scientific problems
SELECT RankNo, [User Link], Reputation, Location FROM ( SELECT Id [User Link], Reputation, Location, DENSE_RANK() OVER (ORDER BY Reputation DESC) RankNo FROM Users WHERE ( lower(Location) LIKE '%new york city%' or lower(Location) LIKE '%nyc%' ) ) derivedtable WHERE LEN(Location) > 1 and RankNo <= ##MaximumRankNo## --ORDER BY RankNo ORDER BY location -- To see incorrectly selected entries