Downvotes on Reopened Questions

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mathematics

Q&A for people studying math at any level and professionals in related fields

SELECT p.PostId,Min(DATEDIFF(day,q.CreationDate,p.CreationDate))
FROM PostHistory p
left join PostHistory q
on p.PostId = q.postId
WHERE p.PostHistoryTypeId = 11
AND DATEDIFF(hour, p.CreationDate, GETDATE() ) < 30
AND DATEDIFF(minute,q.CreationDate,p.CreationDate) >= 0
AND q.PostHistoryTypeId != 11
GROUP BY p.PostId

Enter Parameters

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