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)

Internet of Things Meta

Q&A about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

-- 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 '2020-09-21' AND '2020-09-28'

Enter Parameters

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