Longest delays between consecutive posts from the same user

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers Meta

Q&A about the site for Drupal developers and administrators

WITH Raw AS (
  SELECT
    LAG(Id) OVER (PARTITION BY OwnerUserId ORDER BY Id) AS PrevId,
    LAG(CreationDate) OVER (PARTITION BY OwnerUserId ORDER BY Id)
      AS PrevCreationDate,
    Id,
    CreationDate,
    OwnerUserId
  FROM Posts
  WHERE OwnerUserId > 0
)
SELECT TOP 100
  PrevId,
  PrevId AS [Post Link],
  PrevCreationDate,
  Id,
  Id AS [Post Link],
  CreationDate,
  OwnerUserId AS [User Link],
  DATEADD(S, DATEDIFF(S, PrevCreationDate, CreationDate), '2000-01-01') AS Diff
FROM Raw
ORDER BY DATEDIFF(S, PrevCreationDate, CreationDate) DESC

Enter Parameters

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