Deleted post count by year

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 year(DeletionDate) as "Date", count(id) as "Deleted post count"
from PostsWithDeleted 
group by year(DeletionDate);

SELECT Name, Id from PostHistoryTypes;

SELECT * FROM
(SELECT count(PostId) as "Post Count"
from PostHistory
Where (PostHistoryTypeId = 11) 
and year(CreationDate) > 2003
group by year(CreationDate)) as Reopened,

(SELECT count(PostId) as "Post Count"
from PostHistory
Where (PostHistoryTypeId = 13) 
and year(CreationDate) > 2003
group by year(CreationDate)) as Undeleted,

(SELECT count(PostId) as "Post Count", year(CreationDate) as "Year"
from PostHistory
Where (PostHistoryTypeId = 15) 
and year(CreationDate) > 2003
group by year(CreationDate)) as Unlocked

Enter Parameters

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