I was doing some querying on the Stack Overflow database and I noticed that the creation date of a post is sometimes later than the first or subsequent comments. The query below is the most extreme example. Is there a reason for this?
SELECT *
FROM Posts T1
LEFT JOIN Comments T2 ON T1.Id = T2.PostId
WHERE t1.id = 4318161
The following query will give a full list
SELECT
T1.Id AS PostID,
T1.Title,
T2.Text,
DATEDIFF(minute, T1.CreationDate, T2.CreationDate) ReactionMinutes
FROM Posts T1
LEFT JOIN Comments T2 ON T1.Id = T2.PostId
WHERE T2.CreationDate = (SELECT MIN(T3.CreationDate)
FROM Comments T3
WHERE T3.PostId = T1.Id)
AND DATEDIFF(minute, T1.CreationDate, T2.CreationDate) < 0
ORDER BY DATEDIFF(minute, T1.CreationDate, T2.CreationDate)