SQL
x
USE s53613__aiv;
SELECT reporter,
blocked,
notblocked,
total,
Round(Sum(blocked / total) * 100, 2) AS pct
FROM (SELECT reporter,
Sum(IF(result = "blocked", 1, 0)) AS blocked,
Sum(IF(result = "notblocked", 1, 0)) AS "notblocked",
Count(*) AS total
FROM reports AS r
GROUP BY reporter
ORDER BY blocked DESC) AS d
GROUP BY reporter
ORDER BY pct DESC
LIMIT 10;
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.