Naive query to detect exact-match plagiarism

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

SELECT  u.Id AS [User Link],
        p1.Score,
        FORMAT(p1.CreationDate, 'yyyy-MM-dd') AS [Date],
        p1.Id AS [Post Link],
        p2.Id AS [Post Link]
FROM Posts p1 INNER JOIN Posts p2 ON p1.Body = p2.Body -- SUBSTRING(p1.Body, 0, 100) = SUBSTRING(p2.Body, 0, 100)
              INNER JOIN Users u ON p1.OwnerUserId = u.Id
WHERE p1.PostTypeId = 2 AND p2.PostTypeId = 2
  AND p1.Id <> p2.Id
  AND p1.OwnerUserId <> p2.OwnerUserId
  AND p2.CreationDate < p1.CreationDate
  AND p2.parentid = p1.parentid
ORDER BY  u.Id,
          p1.Score DESC,
          [Date]

Enter Parameters

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