Fork of
TOP reviewers pl 2021
by Nux
This query is marked as a draft
This query has been published
by Nux.
SQL
x
-- Re-format wikitable via userscript: TOP reviewers WikiTable Formatter
-- 1: Download results as wikitable.
-- 2: var wikicode = ``; copy(prepareTopWikiTable(wikicode));
-- XOR: https://github.com/Eccenux/wiki-top600-reviewers-pl
SELECT actor_name, review_count
, review_count_i as review_count_intial
, (review_count + review_count_i) as review_count_total
FROM
-- next reviews
(
SELECT actor_name, review_count, IFNULL(review_count_i, 0) as review_count_i
FROM
(
SELECT count(*) as review_count, log_actor
FROM logging
WHERE log_type = 'review' AND log_action = 'approve'
AND log_timestamp >= 20240101000000
AND log_timestamp <= 20241231235959
GROUP BY log_actor
) r_next
-- add initial reviews
LEFT JOIN
(
SELECT count(*) as review_count_i, log_actor as log_actor_i
FROM logging
WHERE log_type = 'review' AND log_action = 'approve-i'
AND log_timestamp >= 20240101000000
AND log_timestamp <= 20241231235959
GROUP BY log_actor
) r_initial ON log_actor_i = log_actor
-- actor_name
LEFT JOIN actor a ON actor_id = log_actor
) top_reviewers
ORDER BY review_count DESC, review_count_i 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.