Skip to content

Instantly share code, notes, and snippets.

@pdbartsch
Last active December 16, 2015 08:29
Show Gist options
  • Save pdbartsch/5406591 to your computer and use it in GitHub Desktop.
Save pdbartsch/5406591 to your computer and use it in GitHub Desktop.
Searching gis.stackexchange for users local to me http://data.stackexchange.com/gis/query/108984/users-in-california
-- users in California
-- with a reputation > 1
-- that have accessed site in past year
SELECT
ROW_NUMBER() OVER(ORDER BY Reputation DESC) AS [#],
Id AS [User Link],
Reputation,
Location,
LastAccessDate,
Age,
AboutMe,
WebsiteURL
FROM
Users
WHERE
(LOWER(Location) LIKE '%california%'
OR LOWER(Location) LIKE '%, ca')
AND Reputation > 1
AND LastAccessDate >= Convert(datetime, '2012-04-17')
ORDER BY
Location ASC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment