Deep Dive

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

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 DATEDIFF(month, u.CreationDate, GETDATE()) <= ##MaxMonthAge:int?60##
  AND p1.Id <> p2.Id
  AND p1.Score > 2
  AND p1.Score < 30
  AND p1.OwnerUserId <> p2.OwnerUserId
  AND p1.CreationDate BETWEEN ##StartDate:string?2013-01-01## AND ##EndDate:string?2013-12-31##
  AND p2.CreationDate < p1.CreationDate
  AND p2.CreationDate <= ##EndDate:string?2013-12-31##
  AND ##MinLength:int?100## <= LEN(p1.Body)
ORDER BY
  u.Id,
  p1.Score DESC,
  [Date]

Enter Parameters

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