question deleted per day, total number and some analysis

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

select cast(deletiondate as date)
     , count(*)
from postswithdeleted
where deletiondate is not null
and posttypeid = 1 -- Q
group by cast(deletiondate as date)
order by cast(deletiondate as date) asc

select count(*)
from postswithdeleted
where deletiondate is not null
and posttypeid = 1 -- Q

select avg(cnt) as avgOverall
from (
select cast(deletiondate as date) as dat
     , count(*) as cnt
from postswithdeleted
where deletiondate is not null
and posttypeid = 1 -- Q
group by cast(deletiondate as date)
) as magic

Enter Parameters

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