Find the longest-living answer on the Overlapping Polyglots challenge


Please login or register to vote for this query.

(click on this box to dismiss)

Code Golf and Coding Challenges

Q&A for programming puzzle enthusiasts and code golfers

declare @answerType tinyint;
SELECT TOP 1 @answerType = Id FROM PostTypes WHERE Name = 'Answer';
SELECT Id as [Post Link],
       OwnerUserId as [User Link],
       CreationDate, DATEDIFF(HOUR, Posts.CreationDate,
       LEAD(Posts.CreationDate, 1, GETDATE())
    OVER (PARTITION BY ParentId, PostTypeId ORDER BY CreationDate))
    AS SurvivalTime
  FROM Posts
  WHERE PostTypeId = @answerType
    AND ParentId = 171884
  ORDER BY CreationDate ;

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results