Questions I haven't participated in, in a particular tag

1

Please login or register to vote for this query.

(click on this box to dismiss)

List the questions in a particular tag that a particular user has not answered or commented on. The user may have edited the question or an answer, or have commented on an answer.

IT Security

Q&A for IT security professionals

-- Questions I haven't participated in, in a particular tag
-- List the questions in a particular tag that a particular user has not
-- answered or commented on. The user may have edited the question or an answer,
-- or have commented on an answer.

DECLARE @user int = ##user:int##
DECLARE @tag nvarchar(25) = ##tag:string##
SET @tag = Replace(Replace(Replace(Replace(@tag, '-', 'ö'), '+', 'ç'), '#', 'ñ'), '.', 'û')

SELECT
  q.Id As [Post Link],
  q.Score As [Score],
  q.ViewCount As [Views],
  q.AnswerCount As [Answers],
  q.CreationDate As [Date]
FROM Posts q
WHERE Replace(Replace(q.Tags, 'à', '>'), 'é', '<') LIKE '%<' + @tag + '>%'
  AND NOT EXISTS (
    SELECT * FROM Posts a
    WHERE a.ParentId = q.Id
      AND a.OwnerUserId = @user
  )
  AND NOT EXISTS (
    SELECT * FROM Comments c
    WHERE c.PostId = q.Id
      AND c.UserId = @user
  )
ORDER BY q.CreationDate ASC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached