SELECT p.Id AS [Post Link], p.Body, p.CreationDate, User ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Latin Language Meta

Q&A about the site for linguists, teachers, and students wanting to discuss the finer points of the Latin language

SELECT p.Id AS [Post Link], p.Body, p.CreationDate, User
FROM (
  SELECT * FROM Posts
  WHERE PostTypeId = 1
    AND LEN(Body) < LEN(Title) + 30
    AND LEN(Body) > LEN(Title)
) p
INNER JOIN (
  SELECT ph1.* FROM PostHistory ph1
  INNER JOIN (
    SELECT PostId, MAX(CreationDate) AS CreationDate
    FROM PostHistory
    WHERE PostHistoryTypeId IN (2,5,8)
    GROUP BY PostId
  ) ph2
  ON ph1.PostId = ph2.PostId AND ph1.CreationDate = ph2.CreationDate
  WHERE PostHistoryTypeId IN (2,5,8)
) ph
ON p.Id = ph.PostId
WHERE LOWER(p.Title) = LOWER(ph.Text)
ORDER BY CreationDate

Enter Parameters

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