glorfindel-SE-Userscripts/hnq-research/HNQ-average-time-by-site.sql

8 lines
268 B
MySQL
Raw Normal View History

2018-09-02 09:39:29 +00:00
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