glorfindel-SE-Userscripts/hnq-research/HNQ-average-time-by-site.sql
2018-09-02 11:39:29 +02:00

8 lines
No EOL
268 B
SQL

SELECT site, ROUND(AVG(time), 2) AS "average time", COUNT(*) AS "# of Q"
FROM (
SELECT site, question, COUNT(*) / 6.0 AS time
FROM snapshots
GROUP BY site, question
ORDER BY COUNT(*) DESC
) AS subquery GROUP BY site
ORDER BY AVG(time) DESC