Posts Within 1 Day Of User Creation

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

--DATEPART, DATEADD, DATEDIFF
-- DATEPART(unit, date)
-- DATEADD(unit, amount, date)
-- DATEDIFF(unit, startdate, enddate)

--SELECT COUNT(*) FROM Posts
--WHERE CreationDate > DATEADD(day, -28, GETUTCDATE())

SELECT TOP 10 Users.Id, COUNT(*) FROM Users
JOIN Posts ON Users.Id = Posts.OwnerUserId
WHERE ABS(DATEDIFF(day, Posts.CreationDate, Users.CreationDate)) < 1
GROUP BY Users.Id

Enter Parameters

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