2018 Slowest Gun In The West

0

Please login or register to vote for this query.

(click on this box to dismiss)

Programming Puzzles and Code Golf

Q&A for programming puzzle enthusiasts and code golfers

SELECT A.Id AS [Post Link], A.Score, U.DisplayName,
    DATEDIFF(day, Q.CreationDate, A.CreationDate) AS DelayInDays
  FROM Posts A JOIN Posts Q ON A.ParentId = Q.Id
       JOIN Users U ON A.OwnerUserId = U.Id
    WHERE
    -- Answer was posted in 2018
    year(A.CreationDate) = 2018
    -- No tips question
    AND Q.Tags NOT LIKE '%tips%'
    -- At least score of 3 (this is arbitrary)
    AND A.Score >= 3
    -- No post with Q as parent was made within 48 hours of posting
    AND NOT EXISTS (SELECT *
                    FROM Posts A2
                    WHERE A2.ParentId = Q.Id
                    AND DATEDIFF(second, Q.CreationDate, A2.CreationDate) < 86400 * 2)
  ORDER BY A.Score DESC, DelayInDays DESC

Enter Parameters

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