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)

Vegetarianism

Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more

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 meta site
loading Hold tight while we fetch your results