Find a User

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @ResultRows Int = ##RowsToReturn##
DECLARE @CreationDate DateTime = '##CreationDate##'
DECLARE @UserId Int = ##UserId##
DECLARE @Name Varchar(40) = '##UserName##'


SELECT Top (@ResultRows) *, 
'http://stackoverflow.com/users/' + cast(Id as Varchar(100)) + '/' + DisplayName AS SiteUserUrl 
FROM Users
WHERE CreationDate >= @CreationDate
And (Id = @UserId 
    OR (Not Exists (Select * From Users Where CreationDate >= @CreationDate And Id = @UserId) And DisplayName Like @Name))
ORDER BY CreationDate

Enter Parameters

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