Stack Overflow's deleted first post

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 pwd.Id, PostTypeId, ParentId, pwd.CreationDate, DeletionDate,
       sum(iif(VoteTypeId = 2, 1, 0)) - sum(iif(VoteTypeId = 3, -1, 0)) Score
from PostsWithDeleted pwd
     join Votes on pwd.Id = PostId
where pwd.Id = 2
group by pwd.Id, PostTypeId, ParentId, pwd.CreationDate, DeletionDate
order by DeletionDate;

select sum(iif(PostTypeId = 1, 1, 0)) questions,
       sum(iif(PostTypeId = 2, 1, 0)) answers,
       count(*) posts,
       sum(iif(DeletionDate is not null, 1, 0)) deleted,
       sum(iif(PostTypeId = 1 and DeletionDate is null, 1, 0)) extant_questions,
       sum(iif(PostTypeId = 2 and DeletionDate is null, 1, 0)) extant_answers
from PostsWithDeleted;

select top 1 *
from PostsWithDeleted
where DeletionDate is not null
order by DeletionDate;

Enter Parameters

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