Question/post ratio by post sequence


Please login or register to vote for this query.

(click on this box to dismiss)

Server Fault

Q&A for system and network administrators

declare @epoch datetime = '2010-10-19';

with sample_posts as(
select rank () over (partition by OwnerUserId order by CreationDate) sequence, 
from PostsWithDeleted
where PostTypeId in (1,2)
--      and CreationDate > @epoch

select --count(*) N, 
       sum(case when PostTypeId = 1 then 1.0 end)/count(*) q_ratio
from sample_posts
where sequence <= 100
group by sequence
order by sequence

Enter Parameters

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