Which questions have I answered more than once?

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 @UserId int = ##UserId##;

SELECT
  A.Id [Post Link],
  DateAdd(hour, -7, A.CreationDate) CreationDate,
  A.Score
FROM
  Posts Q
  INNER JOIN dbo.Posts A
     ON Q.Id = A.ParentId
WHERE
  Q.PostTypeId = 1
  AND A.PostTypeId = 2
  AND A.OwnerUserId = @UserId
  AND EXISTS (
    SELECT *
    FROM
      Posts D
    WHERE
      D.ParentId = Q.Id
      AND D.OwnerUserId = @UserId
      AND A.Id != D.Id
  )
ORDER BY
  Q.Id,
  A.CreationDate;

Enter Parameters

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