SO by LOCATION Anywhere

3

Please login or register to vote for this query.

(click on this box to dismiss)

location, location, location

Ask Ubuntu

Q&A for Ubuntu users and developers

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 sites:
loading Hold tight while we fetch your results