SELECT DATEPART(YEAR, Posts.CreationDate) as Year, COUNT(...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Ebooks

Q&A for ebook publishers and readers

SELECT 
    DATEPART(YEAR, Posts.CreationDate) as Year,
    COUNT(*) as IssueCount,
    AVG(CAST(Posts.Score as FLOAT)) as AvgScore,
    SUM(CASE WHEN Posts.AcceptedAnswerId IS NOT NULL THEN 1 ELSE 0 END) as ResolvedIssues
FROM Posts
LEFT JOIN PostTags ON Posts.Id = PostTags.PostId
LEFT JOIN Tags ON PostTags.TagId = Tags.Id
WHERE Tags.TagName IN ('cancellation', 'refunds', 'booking-changes', 'flexibility')
    AND Posts.PostTypeId = 1
GROUP BY DATEPART(YEAR, Posts.CreationDate)
ORDER BY Year DESC;

Enter Parameters

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