Search the others answer posts...

1

Please login or register to vote for this query.

(click on this box to dismiss)

This query returns the linked list of the answers of a certain user partially matching the entered body text. This search is not case sensitive. The OtherUserID parameter is the ID of a user whose answers you want search in and the PostText is the text which you want to search for.

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @OtherUserID INT = ##OtherUserID:int##
DECLARE @PostText nvarchar(600) = ##PostText:string##

SELECT @PostText = UPPER(@PostText)
SELECT
    Id AS [Post Link],
    Score AS [Score],
    CreationDate AS [Creation Date]
FROM
    Posts    
WHERE
    OwnerUserId = @OtherUserID AND
    PostTypeId IN (2, 3) AND
    UPPER(Body) LIKE '%' + @PostText + '%'
ORDER BY
    CreationDate
DESC

Enter Parameters

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