Interactions with a specific user

0

Please login or register to vote for this query.

(click on this box to dismiss)

Have I interacted with this user before? (I.e., answered their question or commented on a post.)

Stack Overflow

Q&A for programmers

SELECT 'Answer'       AS Type,
       q.Id           AS [Post Link],
       NULL           AS [Comment Link],
       a.CreationDate AS Date
FROM   Posts a, Posts q
WHERE  a.ParentId = q.Id
       AND a.PostTypeId = 2
       AND a.OwnerUserId = ##UserId:int##
       AND q.OwnerUserId = ##TargetUserId:int##

UNION ALL

SELECT 'Comment'      AS Type,
       c.PostId       AS [Post Link],
       c.Id           AS [Comment Link],
       c.CreationDate AS Date
FROM   Comments c, Posts p
WHERE  c.PostId = p.Id
       AND c.UserId = ##UserId:int##
       AND p.OwnerUserId = ##TargetUserId:int##
       
ORDER BY Date ASC

Enter Parameters

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