This commit is contained in:
Glorfindel 2018-12-22 18:58:33 +01:00
parent 050c1e9a27
commit ba2103da9e

View file

@ -1,4 +1,5 @@
SELECT site, ROUND(AVG(time), 2) AS "average time", COUNT(*) AS "# of Q"
SELECT RANK() OVER(ORDER BY AVG(time)),
site, ROUND(AVG(time), 2) AS "average time", COUNT(*) AS "# of Q"
FROM (
SELECT site, question, SUM(CASE
WHEN timestamp BETWEEN '2018-11-02 18:36:00' AND '2018-11-05 05:30:00'
@ -9,4 +10,4 @@
GROUP BY site, question
ORDER BY COUNT(*) DESC
) AS subquery GROUP BY site
ORDER BY AVG(time) DESC
ORDER BY AVG(time) DESC