Feature-requests by the delay of becoming [status-completed]

1

Please login or register to vote for this query.

(click on this box to dismiss)

Ask Ubuntu

Q&A for Ubuntu users and developers

WITH Raw AS (
  SELECT
    Id,
    PostId,
    Text,
    LAG(Text) OVER (PARTITION BY PostId ORDER BY Id) AS PrevText
  FROM PostHistory
  WHERE
    PostHistoryTypeId = 6
),
Raw2 AS (
  SELECT MIN(Id) AS Id, PostId
  FROM Raw
  WHERE
    (PrevText IS NULL OR PrevText NOT LIKE '%<status-completed>%')
    AND
    Text LIKE '%<status-completed>%'
    AND
    Text LIKE '%<feature-request>%'
  GROUP BY PostId
)
SELECT
  Posts.Id AS [Post Link],
  Posts.Id AS PostId,
  Posts.CreationDate AS PostCreationDate,
  PostHistory.CreationDate AS PostHistoryCreationDate
FROM Raw2, PostHistory, Posts
WHERE
  Raw2.Id = PostHistory.Id
  AND
  PostHistory.PostId = Posts.Id
ORDER BY DATEDIFF(s, Posts.CreationDate, PostHistory.CreationDate) DESC, Posts.Id

Enter Parameters

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