Average response time by tags

0

Please login or register to vote for this query.

(click on this box to dismiss)

The average response time for most popular tags (with at least one vote)

Physics

Q&A for active researchers, academics and students of physics

-- Average response time by tags
-- The average response time for most popular tags (with at least one vote)

declare @limit int = 100;
declare @tag_name nvarchar(35) = 'snowflake-cloud-data-platform';
declare @tag_id int = (select id from tags where tagname = @tag_name);
with post_comments as
(
select
  postid
  , min(creationdate) as first_comment
from comments
group by postid
)
select
  count(distinct posts.id) as posts_with_comments
  , avg(datediff(hour, posts.CreationDate, post_comments.first_comment)) as average_response_time_in_hours
from posts
inner join post_comments
  on posts.id = post_comments.postid
where
  posts.CreationDate BETWEEN '2021-01-06' AND '2021-01-12'

Enter Parameters

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