11

Is there a way to check if a particular user has ever answered or commented on one of my questions or commented on an answer to one of my questions? Also, is there a way to learn the opposite - if I ever answered/commented on one of their questions? Of course, needless to say I would like to be able to see which this question was (similar to how I see for which question I earned a badge).

  • better would be if you ever had an interaction with the user. But interaction itself is a relative and vague term here – Bleeding Fingers Oct 31 '13 at 6:09
  • 2
    Use google for example: "drupal.stackexchange.com bala , clive" – Bala Oct 31 '13 at 6:10
  • @hus787 - at first I wanted to formulate the question exactly using the word interaction, but I think this also includes an up/down vote, so I decided to be more precise. – Alex Popov Oct 31 '13 at 6:18
11

Here you go using Data.SE query:

--Answers on your question
SELECT 'Answers' AS Post_Type, p1.ID AS [Post Link], p1.* 
  FROM Posts p1
  JOIN Posts p2 ON p1.ID = p2.ParentId
   AND p2.OwnerUserId = ##AnswererUserId##
 WHERE p1.OwnerUserId = ##AskerUserId##
--Comments on your posts
UNION ALL
SELECT 'Comments on question' AS Post_Type, p1.ID AS [Post Link], p1.* 
  FROM Posts p1
  JOIN Comments c1 ON p1.ID = c1.PostID
   AND c1.UserId = ##AnswererUserId##
 WHERE p1.OwnerUserId = ##AskerUserId##
--Comments on answers of your question
UNION ALL
SELECT 'Comments on other answers' AS Post_Type, p2.ID AS [Post Link], p2.* 
  FROM Posts p1
  JOIN Posts p2 ON p1.ID = p2.ParentId
  JOIN Comments c1 ON p2.ID = c1.PostID
   AND c1.UserId = ##AnswererUserId##
 WHERE p1.OwnerUserId = ##AskerUserId##
   AND p1.ID <> p2.ID

Add other user's UserId as AnswererUserId and your UserId as AskerUserId. You can also do a viceversa. Here you can know whether it is an answer, a comment, or a comment on other's answres by the first column in the result (i.e. Post_Type)

  • I couldn't bring this query to work. Try this - my id (asker id) is 1836143, the id of user sawa is 314166. When I run the query with these parameters nothing happens. And sawa has answered at least one question of mine. – Alex Popov Oct 31 '13 at 8:48
  • 1
    @AlexBG - Probably you have entered values for Meta Stack Overflow. Just switch the site. See this – hims056 Oct 31 '13 at 8:52
  • Yep, that was it, thank you :) – Alex Popov Oct 31 '13 at 8:54
  • 1
    @AlexBG - Also remember the Data.SE is updated weekly (early every Monday morning around 3:00 UTC). For more about Data.SE see it's help section. – hims056 Oct 31 '13 at 8:56
  • 1
    One more interesting application of this query - if you enter yours (or somebody else's) id both as asker and answerer you'll get a list of all questions you have answered yourself. – Alex Popov Oct 31 '13 at 9:04
  • @AlexBG - Yeah, also comments on your posts. – hims056 Oct 31 '13 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .