The average response time for most popular tags (with at least one vote)
Q&A about the site for professional and amateur woodworkers
-- 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-05-03' AND '2021-05-10'