Droid Hunter

0

Please login or register to vote for this query.

(click on this box to dismiss)

Query to find all exact-match plagiarized Android tag answers.

Code Golf and Coding Challenges Meta

Q&A about the site for programming puzzle enthusiasts and code golfers

SELECT a.*
INTO #AndroidAnswers
FROM Posts q INNER JOIN Posts a ON a.ParentId = q.Id
             INNER JOIN PostTags pt ON pt.PostId = q.Id
             INNER JOIN Tags t ON t.Id = pt.TagId
WHERE t.Id = 1386 -- Android
  AND a.PostTypeId = 2  -- answer
  AND 100 < LEN(a.Body) -- reduce false positives

SELECT -- TOP ##Limit:int?100##
  ROW_NUMBER() OVER (ORDER BY a.OwnerUserId, a.Score DESC, a.CreationDate) AS Rank,
  a.OwnerUserId AS [User Link],
  FORMAT(u.Reputation, '#,###') AS Reputation,
  a.Id AS [Post Link],
  p.Id AS [Post Link],
  a.Score,
  DATEDIFF(day, a.CreationDate, GETDATE()) AS [Days]
FROM Posts p
  INNER JOIN #AndroidAnswers a ON p.Body = a.Body
  INNER JOIN Users u ON a.OwnerUserId = u.Id
WHERE p.PostTypeId = 2 -- answers
  AND p.Id <> a.Id
  AND p.OwnerUserId <> a. OwnerUserId
  AND p.CreationDate < a.CreationDate
ORDER BY a.OwnerUserId, a.Score DESC, a.CreationDate

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results