select
p.id,
comments_per_second = 1.*count_big(1) / datediff(second,p.creationdate,sysdatetime()),
comments_per_second2 = 1.*count_big(1) / datediff(second,max(c.creationdate),sysdatetime())
from posts p
join comments c
on p.id = c.postid
where p.posttypeid = 1
group by p.id, p.creationdate