Search my answer posts by tag...

3

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 @MyUserID INT = ##UserID:int##
DECLARE @Tag nvarchar(25) = ##Tag:string##
DECLARE @PostText nvarchar(600) = ##PostText:string##

SELECT @PostText = UPPER(@PostText)

SELECT
    Answer.Id AS [Post Link],
    Answer.Score AS [Score],
    Answer.CreationDate AS [Creation Date]
FROM
    Posts Question
LEFT JOIN Posts Answer ON Question.ID = Answer.ParentId
WHERE
    Answer.OwnerUserId = @MyUserID AND
    Answer.PostTypeId IN (2, 3) AND
    Question.Tags LIKE '%' + @Tag + '%' AND
    UPPER(Answer.Body) LIKE '%' + @PostText + '%'    
ORDER BY
    Answer.CreationDate
DESC

Enter Parameters

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