SO by LOCATION Anywhere

4

Please login or register to vote for this query.

(click on this box to dismiss)

location, location, location

Economics

Q&A for those who study, teach, research and apply economics and econometrics

DECLARE @myUsers TABLE
(
Id int,
Reputation int,
CreationDate datetime,
DisplayName nvarchar(40), 
LastAccessDate datetime, 
WebsiteUrl nvarchar(200),
Location nvarchar(100), 
AboutMe nvarchar(max), 
Views int,
UpVotes int,
DownVotes int,
ProfileImageUrl nvarchar(200),
EmailHash varchar(32),
AccountId int
)

INSERT INTO @myUsers (Id, Reputation, CreationDate, DisplayName, LastAccessDate, WebsiteUrl, Location, AboutMe, Views, UpVotes, DownVotes, ProfileImageUrl, EmailHash, AccountId)
SELECT Id, Reputation, CreationDate, DisplayName, LastAccessDate, WebsiteUrl, Location, AboutMe, Views, UpVotes, DownVotes, ProfileImageUrl, EmailHash, AccountId
--SELECT *
FROM Users u
WHERE UPPER(u.location) LIKE UPPER('%' + ##Location:string## + '%')

INSERT INTO @myUsers (Id, Reputation, CreationDate, DisplayName, LastAccessDate, WebsiteUrl, Location, AboutMe, Views, UpVotes, DownVotes, ProfileImageUrl, EmailHash, AccountId)
SELECT Id, Reputation, CreationDate, DisplayName, LastAccessDate, WebsiteUrl, Location, AboutMe, Views, UpVotes, DownVotes, ProfileImageUrl, EmailHash, AccountId
--SELECT *
FROM Users u
WHERE UPPER(u.AboutMe) LIKE UPPER('%' + ##Location:string## + '%')

SELECT *
FROM @myUsers

--SELECT COUNT(id)
--FROM @myComments

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results