Youngest accounts have mutual question-answers

1

Please login or register to vote for this query.

(click on this box to dismiss)

Robotics Meta

Q&A about the site for professional robotic engineers, hobbyists, researchers and students

WITH Raw AS (
  SELECT Q.OwnerUserId AS QUserId, A.OwnerUserId AS AUserId
  FROM Posts Q, Posts A
  WHERE
    Q.OwnerUserId > 0
    AND
    A.OwnerUserId > 0
    AND
    Q.CommunityOwnedDate IS NULL
    AND
    A.CommunityOwnedDate IS NULL
    AND
    A.ParentId = Q.Id
    AND
    Q.OwnerUserId <> A.OwnerUserId
  GROUP BY
    Q.OwnerUserId, A.OwnerUserId
),
Raw2 AS (
  SELECT QUserId, AUserId
  FROM Raw

  INTERSECT

  SELECT AUserId AS QUserId, QUserId AS AUserId
  FROM Raw
)
SELECT QUsers.AccountId AS QSEId, AUsers.AccountId AS ASEId
FROM Raw2, Users QUsers, Users AUsers
WHERE
  Raw2.QUserId = QUsers.Id
  AND
  Raw2.AUserId = AUsers.Id
  AND
  QUsers.AccountId > AUsers.AccountId
ORDER BY QUsers.AccountId + AUsers.AccountId DESC

Enter Parameters

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