Me vs other user

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

SELECT qu.Id AS [Post Link]
     , CONCAT('site://a/', ma.Id, '|', ma.Id) AS [MY Answer]
     , ma.Score AS [MY Score]
     , CASE WHEN qu.AcceptedAnswerId = ma.Id THEN 'Y' END AS [MY Accepted]
     , CONCAT('site://a/', oa.Id, '|', oa.Id) AS [OU Answer]
     , oa.Score AS [OU Score]
     , CASE WHEN qu.AcceptedAnswerId = oa.Id THEN 'Y' END AS [OU Accepted]
FROM       Posts AS ma
INNER JOIN Posts AS qu ON ma.ParentId = qu.Id
INNER JOIN Posts AS oa ON qu.Id = oa.ParentId AND ma.Id <> oa.Id
WHERE ma.PostTypeId = 2
AND   ma.OwnerUserId = ##UserId##
AND   oa.OwnerUserId = ##OtherUserId##
ORDER BY qu.Id

Enter Parameters

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