File size: 405 Bytes
27ec678
 
 
1
2
3
4
-- Median hours to first reply
-- Median of first reply time less creation time, in hours, over tickets created in the month and replied to.
SELECT strftime(created_at, '%Y-%m') AS month, median(epoch(first_reply_at - created_at) / 3600.0) AS value FROM support.ticket WHERE first_reply_at IS NOT NULL AND created_at >= TIMESTAMP '2023-10-01' AND created_at < TIMESTAMP '2026-10-01' GROUP BY 1 ORDER BY 1