Find Users by Location

2

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- LocationQry: Location Query "Enter a location, EG: Boston"
DECLARE @LocationQry     varchar(255)  = ##LocationQry:string##;

SELECT
            u.Id                    AS [User Link],
            u.UpVotes + u.DownVotes AS [Good Citizen Idx],
            u.Reputation,
            u.CreationDate          AS [Joined],
            u.Location
FROM        Users u
WHERE       u.location LIKE ('%' + @LocationQry + '%')
--WHERE       CONTAINS(u.location, 'Bangladesh') -- not full-text indexed. :(
ORDER BY    [Good Citizen Idx]  DESC,
            u.DisplayName,
            u.Reputation  DESC

Enter Parameters

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