SQL
AخA
SELECT RANK() OVER (ORDER BY blocks DESC) AS rank, user_name, COUNT(log_title) AS blocks
FROM logging
LEFT JOIN user ON user_name = REPLACE(log_title, "_", " ")
INNER JOIN actor ON actor_user = user_id
WHERE log_type = "block"
AND log_action = "block"
AND log_actor != actor_id -- Ignore selfblocks
AND log_params LIKE "%in%finit%" -- That's right. We're fuzzy-matching this. *screams*
GROUP BY log_title
ORDER BY blocks DESC
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.