Fastest-closed questions with 5 close votes

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

Select DateDiff(day, CreationDate, Current_Timestamp) as Age,
    (Select count(Distinct p.id) from Posts p where 
    DateDiff(day, p.CreationDate, Current_Timestamp) >
    DateDiff(day, CreationDate, Current_Timestamp)
    and p.PostTypeId = 1) as NumPosts 
    from Posts
Where Posts.PostTypeId = 1
Group by DateDiff(day, CreationDate, Current_Timestamp)
Order by DateDiff(day, CreationDate, Current_Timestamp) desc

Enter Parameters

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