Search my own answer posts by tag...

0

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 @PostText nvarchar(600) = ##PostText:string##
DECLARE @PostTags nvarchar (150) = ##PostTags:string##

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

Enter Parameters

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